fix: preserve Gemini thought_signature in tool call messages - #188
Conversation
Gemini 3 thinking models attach extra_content with thought_signature to function call responses. This must be echoed back on subsequent API calls or the server rejects with a 400 error. The assistant message builder was dropping this field, causing all Gemini 3 Flash/Pro tool-calling flows to fail after the first function call.
|
Which provider are we talking about here? We pushed a commit earlier to preserve all OpenRouter & Nous Portal reasoning - and one that makes it so our Codex Provider works like that too. But openrouter doesn't work like this (neither does nous portal) - so not sure where this fix applies |
This fix is for direct Google AI Studio usage via the OpenAI-compatible endpoint |
… test Pin brace-expansion to 5.0.8 via npm overrides for Dependabot NousResearch#188, and make the LSP workspace tilde-expansion test respect USERPROFILE on Windows. Co-authored-by: Cursor <cursoragent@cursor.com>
…orts to react-router Keep website on brace-expansion 5.0.8 for Dependabot NousResearch#188, bump only the root 5.0.7 slot, and stop forcing nested 1.x consumers onto the 5.x API that broke eslint expand(). Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
extra_content.google.thought_signatureto function call responses. This signature must be echoed back on subsequent API calls or the server rejects with a 400 error._build_assistant_messagewas only extractingid,type, andfunctionfrom tool calls, dropping theextra_contentfield entirely. This caused all Gemini 3 tool-calling flows to fail after the first function call.extra_content(with Pydantic model_dump safety) so it round-trips through the conversation history. Non-thinking models are unaffected -- the field is only included when present.Changes
run_agent.py: Preserveextra_contentfrom tool call objects in_build_assistant_messagetests/test_run_agent.py: Add 2 tests verifying extra_content is preserved when present and omitted when absent