Repository navigation
fix(fusion): handle a stopped or swapped worker like any other cut - #1139
Draft
sosidudku1 wants to merge 2 commits into
Draft
sosidudku1 wants to merge 2 commits into
sosidudku1 wants to merge 2 commits into
Conversation
- A local worker the person stopped, or one swapped for the escalation model, now marks the local leg as possibly wedged, so the next local worker asks the server first instead of waiting out a queue budget. The cut is read before the re-run resets its flags. (ATO-1317) - The re-run on the escalation model reports its tool calls as they start, so a crash mid-re-run leaves its side effects in the checkpoint and the task is not offered as safe to repeat. (ATO-1316) - The fan-out pool starts nothing more once the turn is stopped, also when no budget cap is set. (ATO-1334)
The cap aborts the same signal the pool now checks, so the next task read "not started: the turn was stopped". Ask the cap first.
This was referenced Nov 10, 2026
This branch has not been deployed
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.
Three small fixes to how Fusion treats a worker that ends early.
Stop and swap mark the local server (ATO-1317). The local-leg health mark was set only for a worker cut by its clock, its queue wait, its hand-back or the turn's own stop. A worker stopped with
/worker stop, or swapped for the escalation model byescalationReplace, was cut just the same, but the next local worker then waited a whole queue budget before the mark was set. The cut is now read right after the local turn ends, before the re-run resets those flags, and includes both cases. The note says which one it was ("stopped by the person", "replaced by the escalation model").Re-run side effects in the checkpoint (ATO-1316). The local worker's hook calls
onWorkerToolontool_call_parsed, so the checkpoint knows a side effect started before the task finishes. The re-run's hook did not. Now it does, so a hard crash during the re-run does not offer the task as safe to repeat.Pool after a stop (ATO-1334).
runWorkerTasksonly askedshouldStart, which is wired only when a budget cap is set, so after a stop with no cap the remaining tasks were still started (each ending cancelled at once). The pool now checks the abort signal first and writes "not started: the turn was stopped".Tests added:
local-leg-health.test.ts(person's stop marks the leg),escalation.test.ts(re-run reports its tools),worker-runner.test.ts(stopped pool).Merge notes.
noteCut(...)call at the end ofrunOneTask. Whichever merges second must keepoptions.providerIdas the second argument (and this PR's cause text), or every cut is filed under"local"and the ATO-917 check stops working for the real provider id. fix(fusion): keep local server health per server #1149's testfiles a cut under the worker's own servercatches it.local-leg-health.test.ts, and fix(fusion): count worker spend once and where the person sees it #1130 adds adescribeat the same spot inescalation.test.ts. Keep both sides.turn-budget.test.ts).Not yet checked on the second Mac.