Repository navigation
Conversation
…'s name A tool-call delta carrying only a signature was dropped as empty, so a provider that sends the signature apart from the name and arguments would still lose it. Keep such deltas, attach the signature to the call at the delta's own index, or hold it for the call that starts there next, and never open a call for it, which would reach the model without a name. In live runs with gemini-3-flash-preview, neither Vertex AI's OpenAI-compatible endpoint nor LiteLLM's vertex_ai provider sent this shape; both put the signature on the delta that names the call. Follow-up to google#7441, for the case raised on google#7438.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
This is the follow-up to #7441 for the case @surajksharma07 raised on #7438: a streamed thought signature that arrives on a tool-call delta with no name or arguments. #7441 landed without it (3abea3e); #7485 tracks it.
Problem:
_model_response_to_chunkdrops a tool-call delta that has neither a name nor arguments as empty. A provider that sends the thought signature on such a delta, apart from the call's name and arguments, therefore still loses it, and Gemini 3 rejects the next request in the turn ("Function call is missing a thought_signature in functionCall parts").Solution:
In live runs with
gemini-3-flash-preview, neither Vertex AI's OpenAI-compatible endpoint nor LiteLLM'svertex_aiprovider sent this shape: both put the signature on the delta that names the call (raw deltas below). So the unit tests are what exercise the new path; the live runs show the existing paths are unchanged.Testing Plan
Unit Tests:
New tests in
tests/unittests/models/test_litellm.py, all failing onmainand passing with this change:test_model_response_to_chunk_keeps_a_signature_only_delta: a delta with only a signature is no longer dropped as empty.test_streaming_signature_after_its_call_signs_that_call: a signature-only delta that arrives after its call, with a second call in between, signs the first call and not the second.test_streaming_signature_before_its_call_signs_that_call: a signature-only delta ahead of its call opens no call of its own and signs the call that follows.The four failures are the
TestParseToolCallArgumentslogging tests, which depend on test order and fail the same way onmain(fix in #7461).pre-commit run --filespasses on both changed files, and mypy reports no errors inlite_llm.py.Manual End-to-End (E2E) Tests:
The same live check as on #7441:
gemini-3-flash-previewthrough aRunnerwithRunConfig(streaming_mode=StreamingMode.SSE), asked for the weather and the local time in two cities so the model makes four parallel calls, with every raw tool-call delta logged. The script is in #7441's description (VERTEX_PROJECT=<project> ROUTE=openai|vertex_ai LOG_DELTAS=1 python e2e_parallel.py).OpenAI-compatible endpoint:
LiteLLM
vertex_aiprovider:Checklist
🤖 Generated with Claude Code