-
Notifications
You must be signed in to change notification settings - Fork 116
Gemini 3 Pro function calling fails with missing thought_signature after multiple tool uses #149
Description
When using Gemini 3 Pro (gemini-3-pro-preview) with ADK JS 0.3.0 and @google/genai 1.41.0, multi-turn function calling fails with
a 400 error after 3-4 tool calls. The API reports a missing thought_signature on a functionCall content block.
Error
{
"error": {
"code": 400,
"message": "Unable to submit request because function call getRecentSleep in the 4. content block is missing a
thought_signature."
}
}
Environment
- @google/adk: 0.3.0
- @google/genai: 1.41.0
- Model: gemini-3-pro-preview
- Backend: Vertex AI (GOOGLE_GENAI_USE_VERTEXAI=true)
- Session service: InMemorySessionService
- Thinking config: { thinkingLevel: "HIGH" } (also reproduces with default/no explicit config)
Steps to Reproduce
- Create an LlmAgent with gemini-3-pro-preview and multiple FunctionTools
- Send a prompt that triggers 2+ sequential tool calls
- On the 3rd-4th tool call, the API returns a 400 about a missing thought_signature
Expected Behavior
ADK JS should preserve thoughtSignature fields from model responses and include them in subsequent requests, maintaining the
model's reasoning context across multi-turn function calling.
Context
Gemini 3 enforces strict validation on thought signatures during function calling (unlike 2.5 where it was optional). The Thought
Signatures docs state official SDKs handle this automatically, but ADK JS appears to drop them when building conversation history.
Fixed in other libraries:
- ADK Python: #2565, #3705 — fixed in v1.20.0
- Vercel AI SDK: Gemini 3: Function call is missing a thought_signature in functionCall parts vercel/ai#10344 — fixed in PR #10361
- LiveKit agents-js: @livekit/agents-plugin-google: Gemini 3 Flash function calling fails - missing thought_signature support livekit/agents-js#920 — fixed in PR #921