fix(agent): replay signed Gemini tool turns - #3819
kojiwakayama wants to merge 2 commits into
Conversation
Gemini 3 rejects tool-result requests when the original signed functionCall parts are not replayed. Carry provider metadata through generate and stream, persist it as assistant provider options, and keep it out of SSE and durable model-call telemetry. Constraint: Gemini 3 requires exact thoughtSignature and functionCall replay before the matching functionResponse Rejected: Reconstruct signatures from normalized tool calls | signatures are opaque provider output and cannot be recomputed Confidence: high Scope-risk: moderate Directive: Do not attach whole-turn provider metadata to split assistant replay segments Tested: focused 386-step matrix, active lifecycle, 30,188-step unit sweep, full typecheck and lint, isolated npm build, pinned API docs Not-tested: live credentialed Gemini staging request
|
Warning Review limit reached
Next review available in: 10 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (21)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
📦 Client bundle boundary
A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0927e54494
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Superseded by #3820. The replacement preserves the active-lifecycle and exact Gemini wire coverage while keeping replay metadata internal and out of the public message schema. The Codex P2 thread here is addressed and resolved. |
Agent message parsing previously accepted providerOptions for every role even though provider conversion only preserved it on assistant turns. Reject role-incompatible replay metadata at the validation boundary and lock assistant acceptance plus non-assistant rejection. Constraint: Provider replay metadata represents opaque assistant output and must remain attached only to the original assistant turn Rejected: Strict role-discriminated object schemas | would also reject unrelated unknown keys that the public schema currently strips Confidence: high Scope-risk: narrow Directive: Keep providerOptions scoped to assistant replay messages unless conversion support is intentionally expanded for another role Tested: Schema RED then GREEN; affected 7-suite matrix 149 steps; targeted check, lint, format, anti-slop, test-typecheck, public docs, error docs, and pinned Deno 2.7.7 API docs Not-tested: Live Gemini credentials
Summary
Root cause
The Google runtime already captured the exact signed assistant parts required by Gemini 3, but the agent runtime bridge dropped
providerMetadatabefore building the next tool-result request. Gemini 2.5 tolerated the reconstructed call; Gemini 3 rejected the unsigned continuation with HTTP 400.Verification
Not tested against live Gemini credentials; the wire regression uses the real Google runtime and request builder with a mocked transport.
Closes veryfront/veryfront-issue-inbox#549