fix(vertexai): preserve signed thought text parts - #2052
Merged
Conversation
Gemini 2.5/3.x thinking models attach an opaque thoughtSignature to functionCall parts that must be echoed back on subsequent turns, else Vertex rejects the request with INVALID_ARGUMENT. Capture it into ToolCall.signature (base64) on the read side and echo it back via Part::set_thought_signature on the write side. A malformed signature is dropped with a warning rather than failing the whole turn; a signature-bearing part with no function_call/text is logged before being dropped. Mirrors the pattern already present in the direct Gemini provider (rig PR #1396).
This was referenced Jul 9, 2026
This was referenced Jul 11, 2026
Closed
Merged
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.
Summary
feat(vertexai): round-trip Gemini thoughtSignature in tool-calling loopcommit in branch historyAssistantContent::ReasoningAssistantContent::Reasoningback to Vertex asthought=truetext parts with decodedthought_signatureCargo.lockfor therig-vertexaibase64 dependency introduced by feat(vertexai): round-trip Gemini thoughtSignature in tool-calling loop #2027Verification
cargo fmtcargo test -p rig-vertexai -- --nocapturecargo clippy -p rig-vertexai --all-targets -- -D warnings