Skip to content

Comments

fix(gemini): preserve thought signatures for Gemini 3.0 compatibility#1

Merged
amacsmith merged 1 commit intomainfrom
claude/review-tanstack-issues-gsVtQ
Jan 10, 2026
Merged

fix(gemini): preserve thought signatures for Gemini 3.0 compatibility#1
amacsmith merged 1 commit intomainfrom
claude/review-tanstack-issues-gsVtQ

Conversation

@amacsmith
Copy link
Owner

Fixes TanStack#216

Gemini 3.0 models require thought signatures to be preserved and sent
back during function calling. When the model returns a functionCall
with a thoughtSignature, it must be included in subsequent API requests
or the API returns a 400 validation error.

Changes:

  • Add optional metadata field to ToolCall type for provider-specific data
  • Update ToolCallStreamChunk to use the ToolCall interface
  • Capture thoughtSignature from Gemini responses in stream processing
  • Include thoughtSignature when formatting messages back to Gemini API

This fix ensures compatibility with Gemini 3.0 Flash and other Gemini 3
models that enforce thought signature validation for tool calls.

Fixes TanStack#216

Gemini 3.0 models require thought signatures to be preserved and sent
back during function calling. When the model returns a functionCall
with a thoughtSignature, it must be included in subsequent API requests
or the API returns a 400 validation error.

Changes:
- Add optional `metadata` field to `ToolCall` type for provider-specific data
- Update `ToolCallStreamChunk` to use the `ToolCall` interface
- Capture thoughtSignature from Gemini responses in stream processing
- Include thoughtSignature when formatting messages back to Gemini API

This fix ensures compatibility with Gemini 3.0 Flash and other Gemini 3
models that enforce thought signature validation for tool calls.
Copilot AI review requested due to automatic review settings January 10, 2026 19:33
@amacsmith amacsmith review requested due to automatic review settings January 10, 2026 19:34
@amacsmith amacsmith merged commit 3894953 into main Jan 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gemini 3 Flash: Function call is missing a thought_signature in functionCall parts

2 participants