Repository navigation
fix: bound remote supervision calls to keep the watcher responsive - #3
Merged
Merged
Conversation
…l the beacon The watcher's per-mate remote calls (liveness probe, remote relaunch, pending-reply observation, reply-mirror read, public-followup collection) now run under a local deadline from bin/fm-watch-remote-lib.sh, defaulting to 60 s and overridable through FM_WATCH_REMOTE_TIMEOUT, on top of the unchanged SSH keepalives. The watcher refreshes its beacon between mates and between pending-reply records. A timed-out probe is classified ambiguous, never dead: it authorizes no relaunch and logs one bounded triage line per timeout episode, reset by a responsive probe. Remote crew-state reads discard a partial timed-out response instead of reading a dead prefix as a verdict. Tests fake a hanging remote command and prove the cycle completes, the beacon stays within grace, no relaunch is attempted, and the triage line appears once per episode; the watcher case fails on the unchanged code.
…nd reply delivery
This was referenced Oct 12, 2026
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
Bound the watcher's remote second-mate calls so a thrashing or unreachable host cannot stall the supervision beacon.
Context: on 2026-09-28 and again on 2026-09-29 the primary firstmate's watcher (bin/fm-watch.sh) went stale past its 300 s grace while one of its per-cycle remote calls to a registered remote second mate (over bin/fm-on.sh / ssh) ran for 5-7 minutes, first because the MacBook host was swap-thrashing at load 176 and later because that host was down ("Host is down"). The remote secondmate liveness tick, the remote-reply mirror read, and the contributions poll each ran without a local time bound, so the beacon was not refreshed between mates, the Stop-owned auto-arm then exited 2 as failed-suppressed on every turn end, and the only documented remedy, a single TERM to the watcher, was refused by the harness. Supervision of the local fleet and of healthy remote mates degraded for the duration each time.
What Changed
Risk Assessment
✅ Low: The changes reuse existing timeout machinery, preserve ambiguous remote outcomes and retained replies, and refresh the beacon between bounded operations without introducing a substantiated material defect.
Testing
Targeted timeout checks and five live product scenarios passed using isolated local transports. The initial reply fixture refusal was corrected and its rerun passed. CLI evidence was captured, fixtures were cleaned up, and no UI surface was involved.
Evidence: Watcher progress and timeout recovery
Source: Watcher progress and timeout recovery
Evidence: Reply delivery and persisted cursor
Source: Reply delivery and persisted cursor
Evidence: Contributions timeout retains result
Source: Contributions timeout retains result
Evidence: Remote state classification
Source: Remote state classification
Evidence: Deadline validation and output preservation
Source: Deadline validation and output preservation
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.
bash tests/fm-timeout-lib.test.shExecutedtest_watcher_bounds_remote_matesagainst the real watcher using a temporary focused driver.Executed crew-state timeout, unreachable-host, and healthy-idle scenarios using a temporary focused driver.Executed public-followup collection with a 30-second stalling SSH fake andFM_WATCH_REMOTE_TIMEOUT=2.Rantests/fm-remote-reply.test.sh; corrected the disposable fixture's overlapping paths and reran all reply checks successfully.Invokedfm_watch_remote_rundirectly to capture invalid-setting diagnostics and unchanged command output/status.Captured product logs and persisted reply records; removed disposable fixtures and drivers; verified clean git status.✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.