Repository navigation
fix: deliver supervision hand-backs after successor exit - #6227
Closed
alexputici wants to merge 1 commit into
Closed
alexputici wants to merge 1 commit into
alexputici wants to merge 1 commit into
Conversation
Restore downtime explicitly before returning a host-owned wake to main. If the successor closed before the engine drained its grant, no watcher remains to restore that marker and the Claude Stop hook otherwise drops the rewake with exit 0. Report restoration failures through the existing arm-owner failure path. Cover failed latched probes, captain outcomes, and publication failures with real-script regressions and an interactive Claude negative control. Refs kunchenguid#5943
|
Author
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
"Replied via the dashboard, lavish says "agent not listening" so you may not have received them"
Standing instruction: "Apply that same high standard to engineering excellence: lint, test failures, and test flakiness. If you see one, even if it is not caused by what you are working on right now, still get it fixed."
Context: on 2026-09-30, on a Claude primary with the supervision host on and attended, the host latched after repeated engine errors (errors=4, cooldown 1200s). Its next failed engine turn logged a to-main hand-back ("the supervision session could not take this wake ... this wake is yours") at epoch 1790751869, but the primary session never received a Stop hook rewake. No watcher process remained, the last watcher beat stayed at epoch about 1790751784, and the claude autoarm epoch record was left at outcome=arming with a dead owner pid. The fleet then sat unsupervised for about 4.8 hours: two worker completions and three captain board answers went unseen, and the Lavish board source showed owner none until a manual reconcile. The requested outcome is that this failure path can no longer silently leave the fleet unsupervised, delivered as a maintainable upstream correction.
What Changed
bin/fm-supervision-host.shnow republishes the downtime recovery marker inexit_to_mainbefore emitting a to-main hand-back, since a successor that already closed during the engine turn can no longer restore it; without this, Claude's Stop hook silently discarded the rewake and left the fleet unsupervised. If that publication fails, the host logsto-main downtime-unrestoredand exits nonzero without a close, so the arm owner reports the delivery failure instead of treating it as success.tests/fm-supervision-host.test.shaddsheld-emptyresult/held-captainstub modes and two tests: failed probes and captain outcomes rewake main after the successor closes mid-engine-turn, and a failed downtime publication surfaces a committed arm failure (exit 2,outcome=failed) rather than losing the wake.tests/fm-supervision-host-attended-live-e2e.test.shadds an opt-in failed-probe scenario against a real Claude primary, withFM_SUPERVISION_HOST_FAILED_PROBE_CONTROL_REFselecting a pre-fix negative control.docs/supervision-host.mddocuments the downtime restoration in the failure direction and updates the test table;docs/verification/supervision.mdrecords the dated 2026-09-30 live proof (Claude Code 2.1.285) anddocs/verification/runtime-backends.mdlinks to it.Risk Assessment
✅ Low: A one-function production change that restores the recovery marker at the single shared hand-back exit point used by every failure path, verified idempotent against all reachable marker states and sibling exit paths, with behavior-level regression tests at unit and live-E2E level including a pre-fix negative control, and consistent documentation.
Testing
Drove the exact field failure live against a real installed Claude Code 2.1.285 primary in disposable labs: on the pre-fix host (eb77f02) a failed latched engine probe after its successor closed left the idle primary asleep with ledger outcome=arming and no watcher, and on the fixed host the same ordering delivered real Stop-hook feedback, the primary drained and acknowledged, and the next cycle armed a live watcher with errors=4 cooldown=1200 retained; the broader attended scenario (four hand-offs including the successor's own close, a remote-listener event, and an at-turn main-only close) also passed, and the full hermetic family suite (67 assertions through the real host, Stop hook, watcher, and drain scripts against a stub engine) passed including the new adversarial guard where a forced downtime-publication failure exits nonzero with a "watcher auto-arm FAILED" notice instead of silently losing the wake. Terminal capture of the rewoken primary is included as reviewer-visible evidence; the delivery surface is a terminal session, so the pane capture is the rendered end-user surface.
Evidence: Live attended e2e log (pre-fix control, fixed failed-probe, positive scenario)
Source: Live attended e2e log (pre-fix control, fixed failed-probe, positive scenario)
Evidence: Hermetic supervision-host family suite log (67 ok, 0 failed)
Source: Hermetic supervision-host family suite log (67 ok, 0 failed)
Evidence: Terminal capture: real Claude primary handling a Stop-hook rewake (drain + acknowledgement)
Source: Terminal capture: real Claude primary handling a Stop-hook rewake (drain + acknowledgement)
Evidence: Key live evidence lines
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.
FM_SUPERVISION_HOST_ATTENDED_LIVE_E2E=1 FM_SUPERVISION_HOST_FAILED_PROBE_CONTROL_REF=eb77f02b16aeca9533102070de34b1f8812f4fa2 FM_SUPERVISION_HOST_ATTENDED_LIVE_CONTROL_SECONDS=15 bash bin/fm-test-run.sh tests/fm-supervision-host-attended-live-e2e.test.sh (exit 0, 174s, 3 ok: failed-probe-control, failed-probe, positive; real interactive Claude Code 2.1.285 haiku primary in isolated labs on private tmux sockets)bash bin/fm-test-run.sh tests/fm-supervision-host.test.sh (exit 0, 555s, 67 ok, 0 failed; includes the two new regression tests: successor-closed hand-back delivery for failed probes and captain outcomes, and failed hand-back publication surfacing a committed failure)tmux capture-pane of the live lab primary while it handled a Stop-hook rewake (drain, WAKE_ACK_REQUIRED acknowledgement, open decisions), saved as positive-pane-acked.txtpost-run checks: git status clean in the worktree; lab homes, tmux servers, and Claude project transcripts removed by the tests' own teardown✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.