🤖 fix: keep compaction identity across startup auto-retry - #3945
Open
coadler wants to merge 1 commit into
Open
Conversation
deriveStartupAutoRetryRequest rebuilt send options for an interrupted compaction without muxMetadata, so the resumed stream no longer identified as a compaction request. resolveCompactionRequest then aborted its backward scan at any trailing synthetic row (file-change notice, [CONTINUE] sentinel), activeCompactionRequest stayed undefined, and the model's summary was recorded as a plain assistant response instead of collapsing history at a compaction boundary. Carry the original compaction-request metadata through startup retry options and add a regression test covering the interrupted-compaction resume path plus characterization tests for synthetic guidance sends. Co-authored-by: Mux <noreply@coder.com>
Collaborator
Author
|
@codex review |
|
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". |
|
Security review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 24, 2026
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
Startup auto-retry of an interrupted compaction lost the compaction-request metadata, so the resumed stream was no longer tracked as a compaction. The model's summary reply became a plain assistant response and the chat never compacted.
Background
When a stream is interrupted (crash, restart),
deriveStartupAutoRetryRequestrebuilds send options from persisted state. Its compaction branch rebuilt model/agentId/toolPolicy but droppedmuxMetadata, becauseStartupRetrySendOptions.muxMetadataonly allowedworkspace-turn-taskmetadata.On resume,
resolveCompactionRequestscans history backward for the compaction-request row. Without the stream identifying as a compaction request, any trailing synthetic user row — a<system-file-update>file-change notice or the[CONTINUE]sentinel — aborts the scan.activeCompactionRequeststayed undefined,compactionHandler.handleCompletiontreated the stream-end as a normal turn, and no boundary summary was written.Implementation
StartupRetrySendOptions.muxMetadatato also accept{ type: "compaction-request" }.deriveStartupAutoRetryRequest, carry the originalmuxMetadatathrough so the resumed stream still identifies itself;resolveCompactionRequestthen resolves via the options path regardless of trailing synthetic rows.Validation
scheduleStartupAutoRetryIfNeeded), and asserts the boundary lands. Fails before the fix, passes after.preTurnMessages) sends intentionally skip on-send compaction.make static-check, targeted compaction suites green. Fullsrc/node/servicesrun shows only failures verified pre-existing on the pristine baseline (unrelated hooks/browser suites).Risks
Low. The metadata now flows through the same option field
resumeStreamalready consumes;normalizeGatewaySendOptionsspreads it through untouched. The widened union is additive: existingworkspace-turn-taskbehavior is unchanged, and non-compaction retries never set the field.Generated with
xum• Model:openrouter:stealth/ox-alpha• Thinking:high• Cost:$0.04