fix: allow stopping manual compaction#90821
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 9, 2026, 4:18 AM ET / 08:18 UTC. Summary PR surface: Source +62, Tests +128. Total +190 across 4 files. Reproducibility: yes. source-reproducible: current main routes Review metrics: 2 noteworthy metrics.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this focused lifecycle fix after normal exact-head maintainer merge review, then close the canonical Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main routes Is this the best way to solve the issue? Yes, this is the best inspected fix shape: registering the synthetic handle inside the queued manual compaction task keeps the handle scoped to the actual in-flight work and avoids replacing existing budget or reply-run handles. A command-entry registration would cover the wrong lifetime and create more session-state risk. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9566aded5cf8. Label changesLabel justifications:
Evidence reviewedPR surface: Source +62, Tests +128. Total +190 across 4 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review RBP check is now passing (success). The proof section has been updated with real behavior evidence. Please refresh the review verdict and labels. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
c6622ec to
e65c409
Compare
e65c409 to
0406f05
Compare
|
@openperf @vincentkoc — requesting a maintainer proof decision on this one. ClawSweeper's verdict is explicit that the remaining blocker is a human judgment, not a code repair:
Patch quality is already 🦞 diamond lobster; only the proof tier holds the overall at krab. A live gateway
The full chain is Requesting option 2 — accept the source-level chokepoint proof for this bounded renderer-of-lifecycle fix, consistent with the #94154 precedent. If you'd rather require the live transport layer, that needs a maintainer Mantis capture (the only actor that can run it): @openclaw-mantis telegram live proof: verify a real manual /compact in progress is stopped by /stop, with redacted gateway logs showing compaction abort and active-run cleanup. |
|
@clawsweeper re-review Updated the PR body with a Maintainer Decision Requested section. The runtime cancellation lifecycle ( |
c49f0cc to
7cb7d21
Compare
|
@clawsweeper re-review Rebased onto current |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Mantis Telegram Desktop ProofSummary: Mantis captured native Telegram Desktop before/after GIF evidence for /compact and /stop.
Motion-trimmed clips: |
7cb7d21 to
311dae9
Compare
202ef68 to
ce88c48
Compare
|
Maintainer review complete: no blocking findings; this is the best owner-boundary fix for #66535. Land-ready proof on exact head
Direct Codex contract review: Known proof gap: no live Control UI or TUI |
|
Merged via squash.
|
* fix(compact): make queued manual compaction abortable * fix(compact): own manual compaction lifecycle --------- Co-authored-by: Peter Steinberger <[email protected]>




Closes #66535
What Problem This Solves
Fixes an issue where users running manual
/compactcould not stop a slow or stuck compaction with/stop. The work was not discoverable through the active-run lifecycle, so cancellation was a no-op until compaction completed or timed out.Why This Change Was Made
Manual compaction now owns one exact embedded-run handle before setup, native compaction, or lane waiting begins. The handle preserves any existing embedded writer, merges caller and lifecycle abort signals, carries cancellation through context-engine and native-harness compaction, and clears itself on every exit. The command also refuses to start a second writer when a previously aborted run does not drain within 15 seconds.
Budget and preflight compaction keep their existing owner and behavior.
User Impact
Users can stop an in-progress manual compaction through the same
/stoppath used for other active agent work. A stop issued before the queued compaction begins also prevents hooks and compaction work from starting.Evidence
Exact reviewed head:
ce88c48092afd6cca9e537477311d84cbf666b3b.gpt-5.5xhigh autoreview against currentorigin/main: no accepted or actionable findings.Direct Codex contract review confirms the native path is cancellable through this signal:
codex-rs/app-server/src/request_processors/thread_processor.rs:1820-1831submitsOp::Compactfromthread/compact/startand returns.codex-rs/app-server/src/request_processors/turn_processor.rs:1346-1408submitsOp::Interruptand holds a normal interrupt response until terminal abort handling.extensions/codex/src/app-server/compact.ts:117-159,268-278issuesturn/interruptwhen the passed signal aborts and retains its terminal/retirement lifecycle fence.extensions/codex/harness.ts:92-105routes both primary and post-context-engine native compaction through that bridge.Remaining gap: no live Control UI or TUI
/stoptrace against a controllably slow queued or Codex-native compaction. The production cancellation lifecycle and native bridge are covered at source and exact-head CI/Real-proof level.