You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
/compact on the main session aborts running subagents #307
Sending /compact in the main session while a subagent is still working aborts the subagent instead of only compacting the main context.
Observed order in the session:
✗ subagent review → Subagent was aborted · 可回复「重试」让模型换一种方式,或补充说明预期结果
Error: The operation was aborted.
Compaction · Compacted from 225,250 tokens
The child session is torn down first, and compaction only finishes afterwards. The subagent's partial work and its final report are lost, so the task had to be re-dispatched from scratch.
Steps to reproduce
Ask the main agent to do work that spawns a subagent (e.g. a long review task) and wait until the subagent is actively running.
While it is still running, send /compact in the main session.
The subagent is aborted immediately with Error: The operation was aborted., then compaction runs.
Expected behavior
/compact should only rewrite the main session's context. A running subagent lives in its own child session and should keep running unaffected — or at least be cancelled explicitly, not silently aborted as a side effect of compacting the parent.
changed the title [-]D:/Program Files/Git/compact on the main session aborts running subagents[/-][+]`/compact` on the main session aborts running subagents[/+]on Oct 26, 2026
The fix stops manual compaction from tearing down a foreground subagent. Compaction now cancels the parent run with an explicit CompactionAbortError, and the subagent tool ignores only that reason; user cancellation, shutdown, and timeout still stop the child. The regression test failed before the change and passes now, and CI is green.
Update on #313: the approach is now the unified non-aborting one. Manual compaction no longer aborts the current run; it waits for the active run to settle and then compacts, matching automatic compaction. A foreground subagent therefore finishes and its result is compacted. CI is green and the PR is ready for review.
Activity
[-]D:/Program Files/Git/compact on the main session aborts running subagents[/-][+]`/compact` on the main session aborts running subagents[/+]li-xiu-qi commentedon Oct 27, 2026
I’ve picked this up and opened PR #313: #313
The fix stops manual compaction from tearing down a foreground subagent. Compaction now cancels the parent run with an explicit CompactionAbortError, and the subagent tool ignores only that reason; user cancellation, shutdown, and timeout still stop the child. The regression test failed before the change and passes now, and CI is green.
fix(coding-agent): make manual compaction non-aborting
li-xiu-qi commentedon Oct 27, 2026
Update on #313: the approach is now the unified non-aborting one. Manual compaction no longer aborts the current run; it waits for the active run to settle and then compacts, matching automatic compaction. A foreground subagent therefore finishes and its result is compacted. CI is green and the PR is ready for review.