Repository navigation
fix: retry supervision hand-back through an inherited Herdr pane - #65
Merged
Merged
Conversation
… pane The hand-back retry submitted only through an inherited tmux pane, so a primary hosted by Herdr stayed deferred. An inherited Herdr pane now uses the same ownership, foreground, busy, and composer guards, and does not start a Herdr server.
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
Supervision hand-back retry only submits through tmux; add the herdr transport so a herdr-hosted primary is re-woken
Resolution recorded by fm-captain-hold.
Decision digest: 5bdc02baef9afb174011b9518ace85ceccc9553f92fc3327f30be8528c439697
Resolution mode: released
Captain decision:
Captain 2026-11-15 (Jobs page note 1794703235-3uxISq): "The 11 firstmate fixes - do all of these". Start now instead of the staggered dates; Grok builds, DeepSeek checks, firstmate repo reviews one at a time (fleet 133), captain merges each.
Parent: fm-watcher-lapse-20261110-d1. From data/fm-watcher-lapse-20261110-d1/report.md section 4 item 3: bin/fm-supervision-handoff.sh:86-105 submits only through an inherited TMUX_PANE with fm_backend_source tmux; this primary runs under herdr (claude -> bash -> herdr server), so retries stay deferred (docs/supervision-host.md:268). Use bin/backends/herdr.sh fm_backend_send_text_submit; needs live verification.
"The 11 firstmate fixes - do all of these" (2026-11-15)
What Changed
bin/fm-supervision-handoff.shadds a Herdr fallback for the hand-back retry. When noTMUX_PANEis inherited, the retry can submit the watcher doorbell throughfm_backend_send_text_submit herdrto the inherited Herdr pane. This requiresHERDR_ENV=1, a validHERDR_PANE_ID, andHERDR_SESSION(or Herdr's default session). The fallback never starts a Herdr server.TMUX_PANEstill takes priority, even when its own checks defer the retry.docs/supervision-host.mdnow describe delivery through the inherited pane's submit primitive instead of tmux only.tests/fm-supervision-host-hook.test.shadds a test where a fake Herdr backend checks that the retry submits with Enter in the inherited Herdr session and writes a watcher operational record.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The new Herdr retry path is narrow. It runs only when TMUX_PANE is absent and the session is still owned. It does not start a Herdr server, and it checks the same things the tmux path does: the pane's shell owns the pinned session, the session is in the foreground, Claude looks idle on screen and in Herdr's native agent state, and the composer is empty. Every check that fails or can't be read leaves the retry deferred. The new test uses a fake herdr CLI and covers each of these cases.
Testing
I ran the change's new targeted hook test, which passed against a fake herdr. I then drove the real bin/fm-supervision-handoff.sh live against a real Claude primary in a guarded Herdr lab session (fm-lab-*). The retry submitted the hand-back through the inherited Herdr pane and re-woke Claude, with the submit confirmed (verdict
empty). Later retries deferred and left a human composer draft untouched. The lab was torn down and the default Herdr session was never touched. The stopped-server guard and the Herdr checks that fire before a submit is attempted (foreign pane, backgrounded session, busy footer, Claude working) were checked only by the fake-herdr test, so they are recorded as untested live. Overall result: go.retry tok1 empty; herdr-pane-after-retry.txt shows the 'Firstmate operational input waiting' prompt submitted and Claude taking a new turn; operational-record.msg holds…deferredretries; herdr-pane-with-human-draft.txt shows the composer still reading '❯ human draft do not overwrite'Evidence: Lab Herdr pane after retries: Claude re-woken by the hand-back operational input
Source: Lab Herdr pane after retries: Claude re-woken by the hand-back operational input
Evidence: Supervision handoff retry log (empty then deferred verdicts)
Source: Supervision handoff retry log (empty then deferred verdicts)
Evidence: Durable operational watcher record delivered by the herdr retry
Source: Durable operational watcher record delivered by the herdr retry
Evidence: Retry log during human draft (deferred x2)
Source: Retry log during human draft (deferred x2)
Evidence: Lab pane showing the human draft preserved after retries
Source: Lab pane showing the human draft preserved after retries
Evidence: Lab home and Herdr lab session ids
Source: Lab home and Herdr lab session ids
Evidence: Retry log excerpt
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
bin/fm-supervision-handoff.sh:144- The new Herdr branch copies the tmux branch's watcher doorbell text word for word (bin/fm-supervision-handoff.sh:144 and :170), along with its pane-shell ancestor walk and foreground pgid/tpgid proof (:116-125 vs :157-164). If someone later edits only one copy, the two transports will send different doorbells or apply different ownership checks. Fix: move the message into one variable and the ancestor/foreground proof into a helper that takes the pane's shell pid, then call it from both branches. This is a refactor only; behavior does not change.docs/supervision-host.md:269- The intent says the Herdr path "needs live verification". The change proves the behavior only against a fake herdr CLI (tests/fm-supervision-host-hook.test.sh). The docs say so honestly: "No new live-harness verification is claimed." No source change is needed. Someone still needs to confirm on a real Herdr-hosted primary that the retry wakes Claude.✅ **Test** - passed
✅ No issues found.
retry tok1 empty; herdr-pane-after-retry.txt shows the 'Firstmate operational input waiting' prompt submitted and Claude taking a new turn; operational-record.msg holds…deferredretries; herdr-pane-with-human-draft.txt shows the composer still reading '❯ human draft do not overwrite'tests/fm-supervision-host-hook.test.shnew function test_handoff_retry_submits_through_the_inherited_herdr_pane only (fake herdr: stopped server, foreign pane/response, backgrounded session, busy footer, native working, human draft, then idle submit) -> okbin/fm-lab-home.sh create $LAB+bin/fm-herdr-lab.sh name/provision fm-lab-handback-3733196-17460+workspace createfor a guarded Herdr labRealclaude --dangerously-skip-permissionslaunched in lab pane w1:p1 with FM_HOME=$LAB (HERDR_ENV=1, HERDR_PANE_ID=w1:p1, HERDR_SESSION=lab, no TMUX_PANE)Lab Claude ranFM_SUPERVISION_HANDOFF_RETRY_SECONDS=20 nohup bin/fm-supervision-handoff.sh tok1 999999as a detached child of its own session, with state/.lock pinned to the Claude pidObserved retry verdictempty, the operational-inbox record, and Claude waking for a new turn (herdr pane read,agent get)Typed a human draft withherdr pane send-text(no Enter), waited two retry cycles, and checked the log showeddeferredand the composer still held the draftTeardown: stopped the handoff owner and watcher,bin/fm-herdr-lab.sh teardown,rm -rf $LAB, then checked that only the default session remains✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.