fix: allow away supervisors to relaunch in-flight tasks - #27
Merged
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.
Intent
"q294y", answering this question: "Y = start a small firstmate fix job for this: the second check accepts relaunches, with a test, opened as a PR to your firstmate copy for your merge".
Earlier, on the problem: "can this be fixed?", about this report: while the captain was away with the words "you can move to other stages", a job's finished plan waited about 6.5 hours because the away supervisor could not restart the job for its next stage (the plan review on another model); on 2026-10-02 the same refusal cost about 2 hours.
Context the ask refers to. Moving a job to its next stage is
bin/fm-control.sh <id> relaunch, which re-entersbin/fm-spawn.shwith RELAUNCH=1.bin/fm-spawn.shhas two away-posture checks for the supervision branch actor:spawn_require_relocated_queued_work(around line 1571) returns early for a relaunch, but the later backlog preflight (around line 3492,if [ "$spawn_preflight_actor" = branch ] && fm_lease_away_relocated; then if [ "$BACKLOG_ROW_STATE" != "queued no no" ]) has no relaunch exemption, and a relaunched task's backlog item is always In flight, so every away relaunch is refused with "spawn refused - the supervision branch under the away-posture record may dispatch only queued unblocked work ...". Evidence: state/branch-outcomes.jsonl seq 2654, 2663 and 3037; fleet issue https://github.com/peterOC26/fleet/issues/221.What Changed
Risk Assessment
✅ Low: The change only adds a relaunch exemption to the second away-posture check, matching the exemptions every other away check already has (lines 1535, 1540, 1573); relaunches still go through the general dispatchable-state check (fm_backlog_row_dispatchable accepts only
in_flight no no/queued no no), so held or blocked items are still refused, branch relaunches must still go through fm-control's control lock, and fresh away spawns keep the queued-only rule.Testing
The broader test-file attempt hit a fixture-location restriction; focused checks passed and the base reproduced the bug. After correcting lab setup, all three real Codex/tmux scenarios passed. CLI evidence was saved and disposable resources were removed.
Evidence: Live relaunch, guard refusals, persisted records, and cleanup
Source: Live relaunch, guard refusals, persisted records, and cleanup
Evidence: Real replacement worker responds after relaunch
Source: Real replacement worker responds after relaunch
Evidence: Base commit reproduces the reported refusal with simulated endpoints
Source: Base commit reproduces the reported refusal with simulated endpoints
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
TMPDIR="$PWD/.test-tmp" bash tests/fm-control-relaunch.test.sh— stopped at a second-mate fixture-location restriction.Temporary focused runner executed the three new away regression tests plus backlog re-verification and drift-recovery tests; all passed after correcting fixture cleanup.Executed the focused regression against base commit 26e924e6b9deffba0597b151d1519d029561c931; it failed with the reported queued-work refusal.python3 ~/.no-mistakes/evidence/01M45JK2T8YBWNQFKRGCB50VWY/live-away-relaunch.py— real Codex primary and worker on a private, 120×40 tmux session in a marked lab.Inspected CLI captures, relaunch journal, task records, backlog state, preserved unfinished file, and git HEAD.Stopped the private tmux server, removed disposable fixtures and the temporary runner, and confirmed a clean working tree.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.