Skip to content

Gemini 3 function calls fail with missing thought_signature error after multiple tool uses #3705

Description

@haseryo0403

Describe the bug

When using Gemini 3 models with ADK's native Gemini integration (not LiteLLM), complex tasks involving multiple tool calls fail with a 400 error stating that function calls are missing thought_signature.

Important: This issue occurs even when using Gemini(model="gemini-3-pro-preview") directly, not LiteLLM. As mentioned in #3627 (comment) , the recommendation is to use ADK's native Gemini integration to avoid thought_signature issues, but this error shows that native integration alone does not solve the problem.

To Reproduce

from google.adk import Agent
from google.adk.models.google_llm import Gemini

agent = Agent(
    name="search_agent",
    model=Gemini(model="gemini-3-pro-preview"), # Using native Gemini, not LiteLLM
    tools=[google_search_tool],
)

# Execute complex task requiring multiple tool calls
response = await agent.ask_stream(
    messages=[Message(role=MessageRole.USER, contents=[
        TextContent(text="Complex task requiring multiple searches")
    ])]
)

Error

400 Bad Request
{
  "error": {
    "code": 400,
    "message": "Unable to submit request because function call `default_api:google_search` in the 5. content block is missing a `thought_signature`. Learn more: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/thought-signatures",
    "status": "INVALID_ARGUMENT"
  }
}

The error occurs in the 5th content block after multiple tool invocations.

Expected behavior

ADK's native Gemini integration should automatically handle thought_signature requirements for function calling. Users should not need to manually manage this Gemini 3-specific requirement.

Environment

  • OS: macOS
  • Python version: 3.13
  • ADK version: Latest
  • Are you using LiteLLM: No (using native Gemini class)
  • Model: gemini-3-pro-preview

Additional context

Metadata

Metadata

Labels

models[Component] This issue is related to model supportneeds review[Status] The PR/issue is awaiting review from the maintainerrequest clarification[Status] The maintainer need clarification or more information from the authorstale[Status] Issues which have been marked inactive since there is no user response

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions