Skip to content

fix: support Google/Vertex thought_signature in multi-turn conversations#809

Merged
FL4TLiN3 merged 2 commits intomainfrom
fix/google-thought-signature
Mar 15, 2026
Merged

fix: support Google/Vertex thought_signature in multi-turn conversations#809
FL4TLiN3 merged 2 commits intomainfrom
fix/google-thought-signature

Conversation

@FL4TLiN3
Copy link
Contributor

Summary

  • Fix Gemini 3 models failing with "Function call is missing a thought_signature" on multi-turn tool-calling conversations
  • Root cause: thinking signatures were only preserved for Anthropic's namespace (providerMetadata.anthropic.signature), ignoring Google's google.thoughtSignature and Vertex's vertex.thoughtSignature
  • Add signatureProvider field to ThinkingPart to track which provider namespace the signature belongs to
  • Correctly restore signatures to the right provider namespace when converting back to AI SDK messages

Files changed

  • packages/core/src/schemas/message-part.ts - Add signatureProvider field to ThinkingPart
  • packages/runtime/src/helpers/thinking.ts - Extract signatures from all provider namespaces
  • packages/runtime/src/messages/message.ts - Restore signatures to correct namespace
  • packages/runtime/src/helpers/thinking.test.ts - Add Google/Vertex test cases

Test plan

  • bun run typecheck passes (24/24)
  • bun run test passes
  • bun test packages/runtime/src/helpers/thinking.test.ts passes (12/12)
  • bun run validate:changeset passes

🤖 Generated with Claude Code

FL4TLiN3 and others added 2 commits March 15, 2026 20:15
The thinking signature was only preserved for Anthropic's namespace,
causing Gemini 3 models to fail with "Function call is missing a
thought_signature" on the second turn of tool-calling conversations.

- Extract signature from google.thoughtSignature and vertex.thoughtSignature
- Store signatureProvider to restore the correct namespace on output
- Add tests for Google and Vertex signature extraction

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@FL4TLiN3 FL4TLiN3 enabled auto-merge (squash) March 15, 2026 11:15
@FL4TLiN3 FL4TLiN3 merged commit cbca127 into main Mar 15, 2026
11 checks passed
@FL4TLiN3 FL4TLiN3 deleted the fix/google-thought-signature branch March 15, 2026 11:17
@FL4TLiN3 FL4TLiN3 mentioned this pull request Mar 15, 2026
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.

1 participant