Repository navigation
fix: faulty compaction probe wedges run steering and restart aborts - #154868
Conversation
Contain handle.isCompacting() at both embedded run-registry boundaries: queueing fails closed with the structured compacting rejection, and compacting-mode abort skips an indeterminate handle instead of abandoning the rest of the loop.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 25, 2026, 9:43 PM ET / September 26, 2026, 01:43 UTC (Revision 16). ClawSweeper reviewWhat this changesThe branch contains compaction-state probe failures so embedded and reply-owned runs refuse unsafe steering while restart cancellation continues past a faulty handle. Merge readiness✅ Ready for maintainer review Current main still lets a throwing compaction probe escape steering and interrupt compacting-run cancellation. The linked report remains open, and this PR has a coherent repair with no actionable finding identified in the introduced diff. Priority: P2 Review scores
Verification
How this fits togetherThe active-run registries decide whether a new message can enter a running agent turn and which runs a Gateway restart should cancel. They read state from the running backend, then return a steering outcome or issue cancellation. flowchart LR
A[Incoming message] --> B[Active run registry]
C[Restart request] --> B
B --> D[Compaction state probe]
D --> E{State readable?}
E -->|No| F[Reject steering or skip handle]
E -->|Yes| G[Steer or cancel eligible run]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +41, Tests +117. Total +158 across 8 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep one contained compaction-state reader for both run owners, with structured steering rejection and continued cancellation verified through the normal exact-head merge gates. Do we have a high-confidence way to reproduce the issue? Yes. Current-main source still calls the throwing probe directly at both reported entry points, and the contributor records a before-and-after isolated Gateway scenario; this reviewer did not execute the scenario. Is this the best way to solve the issue? Yes. The patch uses one contained reader at the embedded and reply-owned decision points and preserves healthy-probe steering. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 06da80236ed4. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (15 earlier review cycles; latest 8 shown)
|
runs.ts is over the counted-line cap, so the compaction probe shares a sibling with the abortable and supersede readers it belongs with.
CI triage for the first head (
|
Second head (
|
|
Update: I now have cross-diff evidence for the three compact-shard failures above. My second, unrelated open PR #154923 ( |
|
CI is red here for a reason outside this diff; recording the check so no one waits on me for it. Every failing shard in 35608713517 is the same two assertions in an existing Codex extension test: Why it is not caused by this PR:
So no code change from me, and I am deliberately not touching the shared harness or narrowing the assertion - that would hide a real upstream failure under my PR's name. I will re-run this branch once the harness issue is resolved upstream and report if anything of mine then fails. |
|
Resolved the merge-blocking failures by bringing this branch up to date rather than touching the shared Codex test.
I deliberately did not narrow, skip or adapt that upstream test from a fork PR. Running the full suite locally isn't possible in this environment, so CI is the verification here — will follow up if anything on the new base still fails. |
|
Correction to my previous comment: I wrote that all the failing shards died on the Codex
So the reason the merge should go green is that it lands those four upstream test fixes together — the branch was 340 commits behind |
|
CI on the merged head Retraction: I said #155207 explained the Codex failure. It does not. What the base merge did fix: What fails now (shard numbering is dynamic, so the ids changed):
None of these files are in this PR's diff, which is still exactly I cannot re-run failed jobs from a fork ( |
…acting-probe-isolation
…dded-run-compacting-probe-isolation
Drives the faulty-probe scenario against a live manual compaction instead of a second mocked handle, so steering rejection, cancellation and settlement are all observed through shipped code.
|
Proof upgraded to the production path at @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…acting-probe-isolation
|
Nothing under |
…acting-probe-isolation
|
Post-sync readout for Same assertion, same pool, same window on #156769 and #156723 (both |
|
The single red shard above is a stale base that upstream has already fixed, not this diff.
|
|
CI fact for anyone reading this before the rerun: the only red gate on head So The rest of the lane set at this reading: |
…acting-probe-isolation
…acting-probe-isolation
…acting-probe-isolation
|
Merged as 12e8edc. Compaction probe failures now fail closed across embedded and reply-owned steering, allow cancellation of other eligible compacting runs, and log once per handle. Isolated Gateway before/after and healthy-control proof confirmed safe rejection, queued follow-up completion, and restart health; focused lifecycle/reply/steering tests passed, with green CI and a ready review on the merged head. Thank you @sxh313 for the fix and regression coverage, and @yunligou711-commits for the report! |
…penclaw#154868) Closes openclaw#154700 ## What Problem This Solves Fixes: a failing active-run compaction probe escapes message steering and interrupts restart cancellation of other compacting runs. Reply-owned runs also bypassed the guarded registry path. ## User Impact User impact: an unreadable compaction state refuses steering safely, chat follow-ups remain queued until the active run finishes, and compacting-mode cancellation continues to other eligible runs. Healthy steering is unchanged. No configuration, permissions, storage, or public API changes. ## Why This Change Was Made One contained probe reader now serves embedded queue admission, reply-owned injection, and both restart-abort owners. An indeterminate state rejects steering and skips that handle during compacting-only cancellation. A weak set records the first probe failure per handle so repeated admission checks do not flood logs or retain finished runs. The existing abortability and supersede readers remain beside the compaction reader in the contributor's extracted module. Reply-owned handles use the same containment instead of another exception boundary. ## Evidence Isolated Gateway with a plugin-owned active run and a scripted local HTTP provider; the plugin's `isCompacting()` throws. No product source was altered to inject the fault. - **Before, main `6b8c6921ac83`:** `sessions_send(mode=steer)` surfaced the raw `compaction probe unavailable` exception. A `chat.send(queueMode=steer)` follow-up was incorrectly delivered to the faulty active backend; the provider recorded the injection. - **After:** the same tool call returns the existing structured `queue_message_failed reason=compacting ... gatewayHealth=live` rejection. Chat follow-ups are not injected into the faulty backend; the provider sees the next request only after the first finishes. Both turns complete successfully. Repeated checks across the owners produce one warning for that handle. - **Control, before and after:** a healthy probe accepts the follow-up with `targetDisposition=steered`, and the provider records that exact message. - **Lifecycle:** the isolated Gateway restarts and answers `health` successfully after the runs settle. The contributor's live queued-compaction regression also proves that a faulty preceding handle does not prevent cancellation, settlement, and registry eviction of the eligible compaction. The reply-registry regression covers the corresponding reply-owned abort sweep. Focused checks after merging main: ```text runs.test.ts + runs.steering.test.ts: 69 passed reply-run-registry.test.ts: 105 passed Combined wrapper wall time: 30.34 s compact.hooks.test.ts, faulty-probe case: passed (660 ms test body) reply-registry throwing-probe and compacting-abort cases: 3 passed Combined focused wrapper wall time: 30.09 s ``` The CLI lifecycle import-boundary check exposed an eager diagnostic-facade import from the new shared reader. The reader now imports the same logger directly from its lightweight owner. The existing lifecycle check passes all 3 cases, including signal handling after chunk rotation; rerunning it with both steering/reply owner suites passed 153 tests in 29.23 s without changing test mocks. The live proof uses synthetic local model responses, not an external model provider. It distinguishes a contained rejection from a raw exception; it does not claim that the baseline Gateway process itself crashed. Co-authored-by: sxh <[email protected]> Co-authored-by: Ayaan Zaidi <[email protected]>
Closes #154700
What Problem This Solves
Fixes: a failing active-run compaction probe escapes message steering and interrupts restart cancellation of other compacting runs. Reply-owned runs also bypassed the guarded registry path.
User Impact
User impact: an unreadable compaction state refuses steering safely, chat follow-ups remain queued until the active run finishes, and compacting-mode cancellation continues to other eligible runs. Healthy steering is unchanged. No configuration, permissions, storage, or public API changes.
Why This Change Was Made
One contained probe reader now serves embedded queue admission, reply-owned injection, and both restart-abort owners. An indeterminate state rejects steering and skips that handle during compacting-only cancellation. A weak set records the first probe failure per handle so repeated admission checks do not flood logs or retain finished runs.
The existing abortability and supersede readers remain beside the compaction reader in the contributor's extracted module. Reply-owned handles use the same containment instead of another exception boundary.
Evidence
Isolated Gateway with a plugin-owned active run and a scripted local HTTP provider; the plugin's
isCompacting()throws. No product source was altered to inject the fault.9665d17902cf:sessions_send(mode=steer)surfaced the rawcompaction probe unavailableexception. Achat.send(queueMode=steer)follow-up was incorrectly delivered to the faulty active backend; the provider recorded the injection.queue_message_failed reason=compacting ... gatewayHealth=liverejection. Chat follow-ups are not injected into the faulty backend; the provider sees the next request only after the first finishes. Both turns complete successfully. Repeated checks across the owners produce one warning for that handle.targetDisposition=steered, and the provider records that exact message.healthsuccessfully after the runs settle. The contributor's live queued-compaction regression also proves that a faulty preceding handle does not prevent cancellation, settlement, and registry eviction of the eligible compaction. The reply-registry regression covers the corresponding reply-owned abort sweep.Focused checks after merging main:
The CLI lifecycle import-boundary check exposed an eager diagnostic-facade import from the new shared reader. The reader now imports the same logger directly from its lightweight owner. The existing lifecycle check passes all 3 cases, including signal handling after chunk rotation; rerunning it with both steering/reply owner suites passed 153 tests in 29.23 s without changing test mocks.
The live proof uses synthetic local model responses, not an external model provider. It distinguishes a contained rejection from a raw exception; it does not claim that the baseline Gateway process itself crashed.