Repository navigation
fix(google): stabilize thought-signature replay and evict rejected signatures on every mode (rebase of #2513) - #2577
Conversation
…rtex The durable replay store is not mode-scoped: signatures are written by rememberAndSerializeExtraContent and read back by lookupReplayThoughtSignature on every Google mode, AI Studio included. Eviction was gated on cloud-code-assist/vertex, so an AI Studio turn whose signature the upstream rejected kept that signature in the store and replayed it into every following turn - the store poisons itself and the request keeps failing. Eviction now follows the same scope the write does. Clearing the in-memory Antigravity cache stays CCA/Vertex-scoped because that cache only exists there. Driven red first: with eviction re-gated on CCA/Vertex only the ai-studio case fails (31 pass / 1 fail); with the fix 32 pass.
|
✅ Deterministic PR hygiene checks passed. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughGoogle thought-signature replay now retains bounded history for repeated calls, restores signatures from the end of truncated history, preserves client signatures, and removes rejected signatures from durable storage across request modes. ChangesThought-signature replay
Estimated code review effort: 4 (Complex) | ~45 minutes Suggested reviewers: ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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: 10c112ea2b
ℹ️ 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".
| if (raw.error) { | ||
| const err = raw.error as { message?: string }; | ||
| handleSignatureRejection(err.message); |
There was a problem hiding this comment.
Route signature eviction through the HTTP-error path
A normal Gemini signature rejection is an HTTP 400, but the production Responses flow returns from src/server/responses/core.ts:4948-5005 before calling parseResponse or parseStream, so this handler never runs and the rejected durable signature continues poisoning subsequent turns. The new tests hide this by invoking adapter.parseResponse directly on a 400 response; expose invalidation through the non-2xx transport path and add a server-level regression that exercises an actual provider 400.
AGENTS.md reference: src/AGENTS.md:L17-L19
Useful? React with 👍 / 👎.
…gnatures on every mode (rebase of lidge-jun#2513) (lidge-jun#2577) * fix(google): stabilize thought-signature replay across repeated and truncated history * fix(google): evict rejected signatures on every mode, not just CCA/Vertex The durable replay store is not mode-scoped: signatures are written by rememberAndSerializeExtraContent and read back by lookupReplayThoughtSignature on every Google mode, AI Studio included. Eviction was gated on cloud-code-assist/vertex, so an AI Studio turn whose signature the upstream rejected kept that signature in the store and replayed it into every following turn - the store poisons itself and the request keeps failing. Eviction now follows the same scope the write does. Clearing the in-memory Antigravity cache stays CCA/Vertex-scoped because that cache only exists there. Driven red first: with eviction re-gated on CCA/Vertex only the ai-studio case fails (31 pass / 1 fail); with the fix 32 pass. --------- Co-authored-by: Hsia97 <[email protected]>
…gnatures on every mode (rebase of lidge-jun#2513) (lidge-jun#2577) * fix(google): stabilize thought-signature replay across repeated and truncated history * fix(google): evict rejected signatures on every mode, not just CCA/Vertex The durable replay store is not mode-scoped: signatures are written by rememberAndSerializeExtraContent and read back by lookupReplayThoughtSignature on every Google mode, AI Studio included. Eviction was gated on cloud-code-assist/vertex, so an AI Studio turn whose signature the upstream rejected kept that signature in the store and replayed it into every following turn - the store poisons itself and the request keeps failing. Eviction now follows the same scope the write does. Clearing the in-memory Antigravity cache stays CCA/Vertex-scoped because that cache only exists there. Driven red first: with eviction re-gated on CCA/Vertex only the ai-studio case fails (31 pass / 1 fail); with the fix 32 pass. --------- Co-authored-by: Hsia97 <[email protected]>
Summary
Rebase of #2513 (by @Hsia97) onto current
dev, with the review finding fixed.The original change stabilizes thought-signature replay across repeated and truncated
history. The review objected that eviction was gated on
cloud-code-assist/vertexwhile the durable store is not mode-scoped, and that is correct: signatures are written by
rememberAndSerializeExtraContentand read back bylookupReplayThoughtSignatureonevery Google mode, AI Studio included (
src/adapters/google.ts:311).So an AI Studio turn whose signature the upstream rejected kept that signature in the
store and replayed it into every following turn — the store poisons itself and the request
keeps failing with the same rejection. Eviction now follows the same scope the write does.
Clearing the in-memory Antigravity replay cache stays CCA/Vertex-scoped, because that
cache only exists for those modes.
The test-home isolation the review also asked for is already present on this branch
(
OPENCODEX_HOMEis redirected to anmkdtempdirectory inbeforeEach).Closes #2513.
Verification
The added regression was driven red first:
The new block covers both
ai-studioandvertexso the mode symmetry stays pinned.Checklist
devdevhead (1/1, no conflicts)Summary by CodeRabbit
Bug Fixes
Reliability