Repository navigation
🤖 fix: continuous compaction summary honors a thinking-replay receipt in the retained tail - #6008
Merged
Merged
Conversation
…n the retained tail (#5996) The summarizer searched only the cut head for the Anthropic thinking-repair receipt. A receipt in the retained tail, or one held only by the running turn, left the head's signed thinking in the summary request.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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
The continuous compaction summary now honors the Anthropic thinking-repair receipt (
MuxMetadata.anthropicThinkingReplay: "off") when the receipt sits in the retained tail or exists only on the running turn. Before this change, the summarizer looked for the receipt only in the cut head, so it could send signed thinking that the receipt says must stay out. The headless summary path has no reasoning-rejection retry, so that request fails on the signature 400.Fixes #5996
Background
After a thinking-signature repair (#5994) or a server tool between thinking blocks (#6004), Xum writes the receipt, and later requests in the context segment send no Anthropic thinking.
summarizeContinuousCompactionpassedreplayReceiptMessagesbuilt from the head only. When the receipt was on a tail row, or only in the running turn's in-memory metadata (its partial not yet written), the summary request still carried the head's signed thinking.Implementation
ContinuousCompactor:deps.summarizegets a 4th argument,receiptRows. It is the raw segment snapshot (rows, the same rows the cut is taken from, model-hidden rows included), so an empty receipt-only row counts too.readSnapshotcopies the live turn's receipt onto the live row next tostepStartPartIndices.summarizeContinuousCompactiontakes a requiredreceiptRowsand passes it asreplayReceiptMessages. It is required so that a caller cannot silently fall back to the head alone.continuous.tsforwards it.StreamManager.getStreamInfoand the session host type exposeinitialMetadata.anthropicThinkingReplay. This is one more field on the snapshot object thatgetStreamInfoalready builds.The journal prefix rebuild (
rebuildContinuousPrefix) is unchanged. It already readsprefixSourceRows, which include the tail, and #5994's parity test covers it.Validation
Each test failed before the fix:
summarize'sreceiptRows, while the head is only the older rows.receiptRows.StreamManager: during a real turn,getStreamInforeports no receipt before the server-tool reasoning and"off"after it.Mutation checks: removing each piece on its own fails exactly its test. Dropping the forwarding in
continuous.tsfailstsc.The summary-path test uses the file's existing
MockLanguageModelV3seam, so it asserts on the SDK-level prompt, not on an Anthropic HTTP body.Risks
Low. The receipt check reads the whole segment, which is already in memory, instead of the head. If a receipt is found wrongly, the summarizer sends no thinking. That costs prompt-cache reuse, not correctness.
Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high• Cost:$96.87