fix(agent): withhold replay metadata when a tool call was suppressed - #3826
Conversation
📦 Client bundle boundary
A server module in a client graph aborts hydration in the browser. New leaks fail CI; known leaks are tracked in |
|
Caution Review failedAn error occurred during the review process. Please try again later. 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24b4cb84b6
ℹ️ 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".
24b4cb8 to
8ec96ec
Compare
|
@codex review exact rebased head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8ec96ecbca
ℹ️ 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".
|
@codex review exact head |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97f4b42b5d
ℹ️ 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".
b76d1b1 to
5cc8434
Compare
|
@codex review exact head |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
PR #3820 attaches the provider's raw replay metadata to every streamed assistant message, but when the runtime suppresses an unavailable tool call the persisted parts no longer mirror the raw model turn. The Google request builder then fails its exact-history validation (validateGoogleToolReplay throws TypeError) before any request is sent, killing the continuation client-side. Skip the metadata attach when state.suppressedToolCalls is non-empty so the continuation falls back to synthesized parts — the pre-#3820 behavior for that turn — while the extension's fail-fast validation for genuinely corrupted history stays intact. Refs VERYFRONT-AGENT-9
5cc8434 to
109de08
Compare
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Follow-up to #3820, closing the residual replay failure found in review.
When a streamed Gemini turn contained an unavailable call alongside signed replay content, the runtime removed the unavailable call from canonical history. Replaying the original raw metadata then failed exact-history validation, but removing all metadata also stripped signatures from valid surviving calls and reasoning.
Change
Testing
tool-1call totool-0and failed exact replay validation.2c2091a3975eb9ec8005f62dc56643cf31ac8e9c.Risk
Moderate and contained. The core runtime treats metadata as opaque. Google owns validation and reconstruction. Unsupported custom runtimes retain the synthesized-replay behavior from the first fix, while unsafe provider-specific reconciliation paths fail closed.
Refs VERYFRONT-AGENT-9