Skip to content

Gemini 3.x-flash models fail with "missing thought_signature in functionCall parts" during multi-turn tool calling #331

Description

@githubber197

When using gemini() as the model provider with a Gemini 3.x "thinking" model (e.g. gemini-3.5-flash, gemini-3-pro-preview) inside createAgent + createNetwork, any tool call beyond the first turn fails with a 400 error from the

Gemini API:
{
"error": {
"code": 400,
"message": "Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call default_api:listFiles, position 3. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.",
"status": "INVALID_ARGUMENT"
}
}
This occurs on multi-step tool-calling loops (via createNetwork's router re-invoking the agent), not on the first tool call.

Steps to Reproduce
Create an agent with model: gemini({ model: "gemini-3.5-flash", apiKey: ... }) and at least one tool.
Wrap it in a createNetwork with a router that re-invokes the agent after a tool call (i.e. more than one iteration).
Send a message that triggers a tool call.
On the second network iteration, the request to Gemini fails with the above error.

Environment
@inngest/agent-kit version: 0.13.2
Model: gemini-3.5-flash
Node version: v24.11.0
Occurs after updating to latest agent-kit version, so this isn't a stale-version issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions