Skip to content

fix: stop gate reaped cancellation settlement (0.0.39) - #38

Merged
okisdev merged 2 commits into
mainfrom
fix/stop-gate-reaped-settlement
Jul 26, 2026
Merged

fix: stop gate reaped cancellation settlement (0.0.39)#38
okisdev merged 2 commits into
mainfrom
fix/stop-gate-reaped-settlement

Conversation

@okisdev

@okisdev okisdev commented Jul 26, 2026

Copy link
Copy Markdown
Owner

summary

  • the over budget stop gate settles a cancel_requested worker as task_reaped when its runtime id is absent from a provided background_tasks array, instead of demanding TaskStop on a task the harness already reaped; that demand was unsatisfiable because TaskStop on a reaped id returns a tool_use_error, which emits neither PostToolUse nor PostToolUseFailure, so the existing no task found escape hatch never fired and the block re-emitted every stop until SessionEnd (observed live: eight consecutive blocking rounds, twelve errored calls, zero hook events)
  • settlement goes through one shared settleReapedWorker helper used by both the PostToolUse escape hatch and the new stop gate path, and the stop hook keeps its single output document invariant: the reaped notice rides the block reason while live cancellations or missing runtime failures still demand, and emits alone only when nothing blocks
  • PreToolUse stamps cancelAttemptCount on matching non terminal main session workers targeted by TaskStop or TaskOutput, so a stop input without any background_tasks array settles after two unobserved attempts
  • release 0.0.39: changelog entry plus the seven version fields bumped in lockstep

test plan

already verified

  • node --test --test-timeout=120000 tests/fusion-worker-lifecycle.test.mjs tests/fusion-worker-state.test.mjs tests/task-lifecycle.test.mjs -> 153/153 green, six new cases covering absence settlement, retained demand for tracked ids, queued verdict application, the no list fallback, attempt stamping with the subagent guard, and the mixed case asserting a single stdout document
  • npm test -> 951 pass, 1 skip, 20 fail, all twenty pre-existing and change independent: nineteen breaker-check tests read the live breaker state (identical failures reproduced with this fix stashed) and one known codex-exec signal flake passes standalone 42/42
  • node --test tests/plugin-versions.test.mjs tests/verified-versions.test.mjs -> 4/4 green after the lockstep bump

reviewer should verify

  • interrupt a claude worker mid run in a live session and confirm the next stop settles the record as task_reaped with a single stop output instead of re-demanding TaskStop on the reaped id

notes

  • two gaps stay open by design: a user interrupt of a claude worker still leaves no consumable kill event at interrupt time (this fix settles it at the next stop), and the upstream harness still emits no post event for tool_use_error calls
  • the breaker-check hermeticity leak surfaced by the full suite run (tests reading live lane failure state) is pre-existing and tracked separately

@okisdev
okisdev merged commit 8f1d673 into main Jul 26, 2026
6 checks passed
@okisdev
okisdev deleted the fix/stop-gate-reaped-settlement branch July 26, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant