Repository navigation
fix(ai): preserve Gemini thought signatures on OpenAI Chat tool calls - #51768
Merged
Merged
Conversation
|
Thank you for fixing this ❤️! Is there a chance for it to appear in As
|
Member
Author
|
hm might port for v1 but lemme see about the nixpkgs Also v2 doesnt ship any breaking changes rn without proper semver, so next breaking changes will be in 2.1.x |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #50833 for the V2 native runtime.
Problem
Gemini's OpenAI-compatible surface returns thought signatures on tool calls as
extra_content.google.thought_signatureand rejects a replayed parallel tool call batch without them:V2 routes
@ai-sdk/openai-compatibleproviders through@opencode/ai's OpenAI Chat protocol, which droppedextra_content, so Gemini tool loops with parallel calls over OpenAI-compatible providers failed on the continuation.Changes
extra_content(known shape only) and store it verbatim asproviderMetadata[key].extraContent, the same wayreasoning_detailsis stored asreasoningDetails.extra_content. Core already restricts tool call metadata replay to the producing model.ToolStream.appendOrStartaccepts provider metadata on the delta that starts a call.storeforgenerativelanguage.googleapis.com, which rejects the field (Unknown name "store") and otherwise fails every request to Google's OpenAI endpoint.Tests
gemini-3.8-flash): a parallel two-city tool loop whose continuation replays the signature and succeeds. The same continuation withoutextra_contentreturns the 400 from the issue against the live endpoint.