fix(coding-agent): suppress aborted compaction stream errors - #685
Merged
Conversation
…ncel # Conflicts: # packages/coding-agent/src/core/extensions/builtin/compaction/changes.md
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
Root cause
The compaction watchdog can stop consuming as soon as ESC aborts the caller signal, while the provider stream's final
result rejects a moment later with
Assistant message stream consumption was cancelled. That late rejection escapedrunExtensionCompaction()and was reported by the builtin extension runner after the normal cancellation notice.Verification
test/compaction/speculative-abort-cancellation.test.ts— 2/2 passed.npm run check: passed.origin/mainmerged; post-merge focused tests, compaction suite, andnpm run checkpassed.Manual QA
Source Senpi TUI in a persistent PTY:
Observed:
Context overflow detected, compacting... (esc to cancel)Compacting... (esc to cancel) partial held summaryAuto-compaction cancelledExtension "<builtin:compaction>" errorAssistant message stream consumption was cancelledstackSESSION-USABLE-AFTER-CANCELEvidence is stored locally under
local-ignore/qa-evidence/20260803-compaction-esc/, including an xterm.js-rendered PNG.Summary by cubic
Suppress spurious compaction errors after ESC by treating late summary stream rejections as normal cancellation when the caller
AbortSignalis aborted. Real provider/stream errors still bubble up; adds a focused regression test.runExtensionCompaction(), returnundefinedifgenerateSummaryMessagerejects and the caller signal is already aborted; otherwise rethrow.speculative-abort-cancellation.test.tsto verify both the aborted and ordinary failure paths.Written for commit 1116bd8. Summary will update on new commits.