Repository navigation
fix(bin): report agent-absent endpoints as stopped in crew state and fleet snapshots - #4
Merged
daoudjk merged 3 commits intoOct 8, 2026
Conversation
When the recorded tmux or herdr endpoint exists but its agent process is gone, fm-crew-state reports stopped (source endpoint) instead of unknown whenever the semantic busy source cannot answer, or the run-step is unknown only because a terminal run's code identity is unverified. The home summary lists a stopped child with an In flight row as a held, non-active obligation, so such children no longer make the home unreadable. Running agents, unreadable probes and live or competing runs stay unknown.
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
How can we fix unreadable/invalid Program Management and Workstation Operations records, completed children still in flight in Range Operations and Scenario Fidelity, unavailable Technical Lead activity, and missing endpoints/unreadable primary execution records? I want proper visibility before we start working again so we actually know where we stand. If manual actions are needed, tell me the steps.
What Changed
bin/fm-crew-state.shadds astoppedstate with anendpointsource. It is emitted only when a tmux or herdr endpoint exists andfm_backend_agent_statereports no agent process. This covers three cases: the pane is unreadable, the harness busy source cannot answer, or the selected run is terminal with an unverifiable code identity. Missing, unreachable, alive and ambiguous endpoints keep their existingunknownorworkingreadings. An unreadable-pane dead agent used to readunknown · none; it now readsstopped.bin/fm-fleet-snapshot.shtreats a child instoppedstate as an owned, non-active hold. It appears inholdsand never inactive_children. A secondmate home whose only unreadable children are stopped stays valid and readsexternally_held. The help text states that stopped means the agent is not running, not that the work is finished or accepted.docs/architecture.mdand thefm-crew-state.shheader document the rule. New and updated tests aretests/fm-crew-state-stopped.test.sh(new),tests/fm-crew-state.test.shandtests/fm-fleet-snapshot-view.test.sh.Risk Assessment
✅ Low: The fix round is a one-line state change in the unreadable-pane block that reuses the existing classifier verdict, plus help text and behavioral tests. I found no remaining consumer of the old "backend target gone ... agent gone" wording, and missing and unreachable endpoints still read unknown.
Testing
I ran the three targeted test scripts for the changed crew-state and fleet-snapshot code, and all passed. They exercise the real
fm-crew-stateand snapshot scripts. They cover an unreadable pane with a dead agent reading stopped, missing and unreachable endpoints staying unknown, and the snapshot view rendering. I produced no visual artifacts because this is CLI/script behavior.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
🔧 **Review** - 3 issues found → auto-fixed ✅
bin/fm-fleet-snapshot.sh:1095- A crew whose agent process has died now reads asstopped. The snapshot lists it underholds(source child-state), and a home whose only unreadable children are stopped now reads valid /externally_held. A crashed or abandoned agent with unfinished work therefore looks like a deliberate hold, not a child that needs a restart. The detail text does say 'agent process absent', but the home-level verdict no longer flags it. Whether a dead agent should count as a held obligation is a product decision. If it should not, the smallest remedy is a separatestopped_childrensurface that needs attention. That remedy would extend the change.bin/fm-crew-state.sh:1233- The stated intent covers several failure classes: unreadable Program Management and Workstation Operations records, completed children still in flight, unavailable Technical Lead activity, and missing endpoints or unreadable primary execution records. It also asks for manual steps where needed. This commit only changes how a stopped endpoint is read. Missing endpoints (backend target gone) and unreadable records still produceunknownand invalidate the home. No manual-recovery steps are provided in the change. The change satisfies only part of the stated goal.bin/fm-crew-state.sh:1233- The same dead-agent evidence is read two ways. When the pane is unreadable (earlier block, ~line 1214), adeadclassifier verdict emitsunknown none 'backend target gone ... (agent gone, pane shell remains)'. When the pane is readable but the busy source can't answer, the new code emitsstopped endpoint. A dead agent therefore flips betweenunknownandstoppeddepending on whether the scrollback read happened to succeed, so the home's validity can change with probe timing. Also,endpoint_agent_stoppedre-runs the classifier that the earlier block already ran.🔧 Fix: Read unreadable-pane dead agent as stopped
✅ Re-checked - no issues remain.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-crew-state-stopped.test.shbash tests/fm-crew-state.test.shbash tests/fm-fleet-snapshot-view.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.