fix: stop gate reaped cancellation settlement (0.0.39) - #38
Merged
Conversation
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
cancel_requestedworker astask_reapedwhen its runtime id is absent from a providedbackground_tasksarray, instead of demandingTaskStopon a task the harness already reaped; that demand was unsatisfiable becauseTaskStopon 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)settleReapedWorkerhelper 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 blockscancelAttemptCounton matching non terminal main session workers targeted byTaskStoporTaskOutput, so a stop input without anybackground_tasksarray settles after two unobserved attemptstest 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 documentnpm 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/42node --test tests/plugin-versions.test.mjs tests/verified-versions.test.mjs-> 4/4 green after the lockstep bumpreviewer should verify
task_reapedwith a single stop output instead of re-demandingTaskStopon the reaped idnotes