Repository navigation
fix: require durable leases for dead-endpoint relaunches - #150
Merged
Merged
Conversation
A task whose recorded endpoint disappears (ic-prod-outage-astra-fix, 2026-09-17) could not be relaunched: fm-spawn --relaunch probed the dead pane's cwd, read empty, and refused, while fm-control relaunch refused earlier with "no agent to stop" - leaving an intact leased worktree unreachable through any supported path. Port the upstream herdr recovery (commit 3e817d3, PR kunchenguid#4120, issue kunchenguid#4091): an uninterpretable pane read upgrades to `missing` only when `herdr status --json` positively reports .server.running false, rather than trusting the version-fragile per-pane error code; a drifted live shell gets one `cd` back to the recorded worktree before refusing. fm-spawn --relaunch now classifies the recorded endpoint first: tmux and herdr use the recovery-grade agent_state (only `missing` is gone), while zellij and cmux use a new fm_backend_endpoint_absent structural proof (recorded session/workspace and pane/surface verifiably gone, with a reused id in another task's tab counting as absent). A proven- gone endpoint skips the impossible cwd probe and is recreated inside the recorded worktree - but only after the task proves it still owns that worktree through its .fm-slot-owner claim or its durable fm-<id> Treehouse lease. Live agents, ambiguous/unreadable/unverified states, foreign worktrees, and unprovable ownership all still refuse, and orca stays refused. fm-control relaunch treats a proven-missing endpoint as already stopped - there is no agent to exit - journals the verdict, and continues the transaction so the launch owner recreates the endpoint; the same brief and progress note are preserved throughout.
…cmux absence checks
…absence decisions
dnth
force-pushed
the
fm/fm-relaunch-dead-endpoint
branch
from
September 18, 2026 23:56
bc04b64 to
39ebd76
Compare
This was referenced Sep 20, 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
Captain decision 2026-09-19: require the durable fm- Treehouse lease as the sole worktree-ownership proof on the dead-endpoint relaunch path - relaunch_worktree_lease_proven must refuse a same-task .fm-slot-owner claim that lacks a live lease; fix lands on this branch into PR #150 before merge
What Changed
fm-<id>lease before reusing a recorded worktree during dead-endpoint relaunches, rejecting same-task slot claims without lease proof.Risk Assessment
Testing
Ran the focused end-to-end relaunch harness against the real shell product. All scenarios passed, including durable lease success and refusal of a same-task slot-owner marker without a live lease. Evidence was saved to the dedicated evidence directory.
bash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shEvidence: Dead-endpoint relaunch E2E transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.shbash tests/fm-spawn-relaunch-dead-endpoint.test.sh✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.