Skip to content

fix(bin): read an exited opencode on Herdr as agent-free so relaunch proceeds - #14

Merged
Hozzy02 merged 3 commits into
mainfrom
fm/fm-herdr-opencode-stale-agent
Sep 25, 2026
Merged

Hozzy02 merged 3 commits into
mainfrom
fm/fm-herdr-opencode-stale-agent

Conversation

@Hozzy02

@Hozzy02 Hozzy02 commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Intent

Fix: after an opencode worker exits on the Herdr backend, relaunch refuses because the pane still reads as a live agent. Evidence: after fm-control relaunch delivers opencode's exit the pane returns to its shell and herdr pane process-info shows only a shell in the foreground, but herdr agent explain still says opencode idle with screen_detection_skip_reason full_lifecycle_hook_authority, so the stop step reports agent-state=alive exit=unconfirmed and fm-spawn --relaunch refuses. Required: fix the liveness read in the Herdr backend (bin/backends/herdr.sh, fm_backend_herdr_agent_state, the recovery-grade classifier) so a hook-authority idle/done opencode agent whose pane foreground is only a shell with no harness process counts as agent-free (dead). Captain follow-up from a live stuck pane: the foreground may be the treehouse subshell (a recognized idle shell that is a descendant of the pane shell reached only through shells and the treehouse launcher, no children), not the pane shell itself, and that must also read agent-free. Keep working/blocked/busy cases, live opencode in the foreground, and non-opencode harnesses unchanged. Deliberate decisions: only fm_backend_herdr_agent_state is refined; fm_backend_herdr_pane_agent_state and fm_backend_herdr_pane_idle_shell_pid are intentionally left unchanged because pane-closing paths depend on them; the new subshell proof never prints a pid. Did not emit an exit event from a plugin because the opencode Herdr plugin is a Herdr-managed file overwritten on reinstall. Regression tests in tests/fm-backend-herdr.test.sh cover stale idle/done after exit, genuinely live idle opencode (stays alive), the treehouse-subshell layout, harness-parented and busy-subshell refusals, and non-opencode harnesses. Shellcheck clean via bin/fm-lint.sh; docs/agent-control.md notes the behavior. Caveat: could not reproduce the stale read in an isolated lab on Herdr 0.9.1; verified against the live stuck pane read-only.

What Changed

  • fm_backend_herdr_agent_state in bin/backends/herdr.sh now returns dead (agent-free) for an opencode agent that Herdr still reports as idle/done under hook authority when the pane's foreground is only a shell with no harness process. That shell can be the pane shell or the treehouse subshell: an idle shell with no children that descends from the pane shell only through shells and the treehouse launcher. fm-control can now confirm the exit, and fm-spawn --relaunch no longer refuses. Working/blocked states, busy shells, opencode that is still running in the foreground, and non-opencode harnesses read the same as before. fm_backend_herdr_pane_agent_state and fm_backend_herdr_pane_idle_shell_pid are unchanged, and the new subshell check never prints a pid.
  • New regression tests in tests/fm-backend-herdr.test.sh cover:
    • stale idle/done registrations after exit, which now read dead
    • opencode that is idle but still running, which stays alive
    • the treehouse-subshell layout
    • subshells parented by a harness, and busy subshells, which are refused
    • working/blocked states, which are never reclassified
  • docs/herdr-backend.md documents the exited-opencode liveness rule, and docs/agent-control.md gains a one-line pointer to it.

Review left three info-level notes, none blocking:

  • The subshell check takes a single sample with no settle retry.
  • It does not check sibling jobs under ancestor shells.
  • It adds an extra agent get call to each "live" verdict.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change is limited to fm_backend_herdr_agent_state and only reclassifies idle or done opencode registrations to agent-free after strict proofs (a lone idle shell, or an idle treehouse subshell reached only through shells and treehouse). Pane-closing paths still use the unchanged pane_agent_state and idle_shell_pid, and the regression tests cover the required cases from the intent.

Testing

I ran tests/fm-backend-herdr.test.sh and it passed, including the new agent_state regression tests. I then ran the same fake-herdr/ps scenarios against the base commit and the target commit. On the base, every case read alive, which is the reported refusal. On the target, only an exited opencode with a stale idle/done registration reads dead, whether the foreground is the pane's own shell or the treehouse subshell. Live opencode, harness-parented shells, busy subshells, working/blocked agents and claude stay alive. I did not run a real Herdr pane or the full fm-control relaunch flow; the author notes the stale read could not be reproduced in a lab, so the fake harness plus the dispatch trace from fm-control's exit wait is the evidence. This is a CLI/backend change with no UI surface, so there are no screenshots.

Evidence: Verdict before vs after the fix (12 cases)

BASE 4159b40: all 12 cases -> alive TARGET 9431ebc: opencode idle/done zsh own -> dead opencode idle/done zsh treehouse -> dead opencode idle opencode own/treehouse -> alive opencode idle zsh harness-tree -> alive opencode idle zsh busy-tree -> alive opencode working/blocked zsh own -> alive claude idle zsh own/treehouse -> alive

== BASE 4159b40 (before fix) ==
agent     status   fg        topology      verdict
opencode  idle     zsh       own           alive
opencode  done     zsh       own           alive
opencode  idle     zsh       treehouse     alive
opencode  done     zsh       treehouse     alive
opencode  idle     opencode  own           alive
opencode  idle     opencode  treehouse     alive
opencode  idle     zsh       harness-tree  alive
opencode  idle     zsh       busy-tree     alive
opencode  working  zsh       own           alive
opencode  blocked  zsh       own           alive
claude    idle     zsh       own           alive
claude    idle     zsh       treehouse     alive

== TARGET 9431ebc (after fix) ==
agent     status   fg        topology      verdict
opencode  idle     zsh       own           dead
opencode  done     zsh       own           dead
opencode  idle     zsh       treehouse     dead
opencode  done     zsh       treehouse     dead
opencode  idle     opencode  own           alive
opencode  idle     opencode  treehouse     alive
opencode  idle     zsh       harness-tree  alive
opencode  idle     zsh       busy-tree     alive
opencode  working  zsh       own           alive
opencode  blocked  zsh       own           alive
claude    idle     zsh       own           alive
claude    idle     zsh       treehouse     alive
Evidence: Script that builds the verdict comparison
#!/usr/bin/env bash
# Usage: verdict-matrix.sh <repo-root>; prints fm_backend_herdr_agent_state per scenario using the test file's fake herdr/ps harness.
ROOT=$1; TMP_ROOT=$(mktemp -d)
eval "$(sed -n '/^verdict_topology_ps()/,/^}/p;/^herdr_agent_state_verdict()/,/^}/p' "$2")"
printf '%-9s %-8s %-9s %-13s %s\n' agent status fg topology verdict
while read -r a s f t; do
  printf '%-9s %-8s %-9s %-13s %s\n' "$a" "$s" "$f" "$t" "$(herdr_agent_state_verdict "$a" "$s" "$f" "$t")"
done <<R
opencode idle zsh own
opencode done zsh own
opencode idle zsh treehouse
opencode done zsh treehouse
opencode idle opencode own
opencode idle opencode treehouse
opencode idle zsh harness-tree
opencode idle zsh busy-tree
opencode working zsh own
opencode blocked zsh own
claude idle zsh own
claude idle zsh treehouse
R
Evidence: fm-backend-herdr test run log
ok - fm_backend_herdr_version_check: accepts the current protocol (14)
ok - herdr agent_state: an exited opencode's stale idle or done registration reads dead
ok - herdr agent_state: a genuinely live idle opencode stays alive
ok - herdr agent_state: an exited opencode's idle treehouse subshell reads dead while live, harness-parented, busy, and non-opencode cases stay alive
ok - herdr agent_state: working, blocked, and non-opencode agents are never reclassified
ok - fm_backend_herdr_version_check: refuses an old protocol loudly
ok - fm_backend_herdr_version_check: refuses loudly when herdr is not installed
ok - fm_backend_herdr_workspace_label: a primary home (no marker) resolves to 'firstmate'
ok - fm_backend_herdr_workspace_label: a secondmate home (.fm-secondmate-home) resolves to '2ndmate-<id>'
ok - fm_backend_herdr_workspace_label: trims whitespace around the marker's secondmate id
ok - fm_backend_herdr_workspace_label: an empty marker file falls back to the primary label 'firstmate'
ok - fm_backend_herdr_workspace_label: two different secondmate homes get two different, non-colliding labels
ok - fm_backend_herdr_cli: sets HERDR_SESSION AND appends a trailing --session flag on every call
ok - fm_backend_herdr_launcher_identity: a firstmate not running inside herdr has no launcher workspace to inherit
ok - fm_backend_herdr_launcher_identity: HERDR_ENV=1 without a pane id selects the backend but binds no parent
ok - fm_backend_herdr_launcher_identity: resolves the launcher's exact workspace even when a same-labeled workspace sorts first
ok - fm_backend_herdr_launcher_identity: refuses a launcher pane that names a different herdr session
ok - fm_backend_herdr_launcher_identity: refuses a claimed pane without exact server identity
ok - fm_backend_herdr_launcher_identity: refuses a launcher pane whose injected socket belongs to another herdr server
ok - fm_backend_herdr_launcher_identity: refuses when the launcher's own pane no longer resolves
ok - fm_backend_herdr_launcher_identity: refuses when the launcher's pane and tab disagree about their workspace
ok - fm_backend_herdr_launcher_identity: refuses when the launcher's workspace is gone from its own session
ok - fm_backend_herdr_workspace_ensure: places a worker in the launcher's exact workspace, not the first same-labeled one
ok - fm_backend_herdr_workspace_ensure: refuses to guess between two same-labeled home workspaces
ok - fm_backend_herdr_workspace_ensure: a --secondmate container resolves that home's own workspace, not the launcher's
ok - fm_backend_herdr_container_ensure: surfaces the exact ambiguous-placement refusal instead of a generic failure
ok - fm_backend_herdr_container_ensure: version-gates, starts the server, ensures the firstmate workspace, echoes session:workspace_id + the seeded default tab id
ok - fm_backend_herdr_container_ensure: reuses an existing firstmate workspace without recreating it, and reports no seeded default tab (adopted, not created)
ok - fm_backend_herdr_container_ensure: workspace create passes --no-focus
ok - fm_backend_herdr_container_ensure: creates the workspace under the SECONDMATE home's own label, not 'firstmate'
ok - fm_backend_herdr_create_task: prunes exactly the seeded default tab container_ensure identified, once the first real task tab exists
ok - herdr repeated spawn/teardown: one persistent firstmate workspace reused, zero orphans, default tab pruned, create ran once
ok - fm_backend_herdr_create_task: an ADOPTED workspace's pre-existing tab is never pruned (the created-vs-adopted gate)
ok - fm_backend_herdr_create_task: the label-collision startup-workspace scenario (2026-07-02 incident) leaves the captain's live tab untouched
ok - fm_backend_herdr_workspace_prune_seeded_default_tab: refuses to close the seeded default tab when its pane reports a working agent (defense in depth)
ok - fm_backend_herdr_create_task: refuses a duplicate tab label (herdr's own tab create has no uniqueness check)
ok - fm_backend_herdr_create_task: a same-labeled tab with a live (even idle) registered agent still refuses exactly as before
ok - fm_backend_herdr_create_task: scans every same-labeled tab and refuses if any duplicate is live
ok - fm_backend_herdr_create_task: closes and replaces a same-labeled tab whose pane is dead (pane_not_found)
ok - fm_backend_herdr_create_task: closes and replaces a same-labeled tab whose pane is alive but hosts no registered agent (a restored plain shell)
ok - fm_backend_herdr_create_task: closes every confirmed same-labeled husk only after creating the replacement
ok - fm_backend_herdr_create_task: refuses success when a preexisting husk tab remains after replacement
ok - fm_backend_herdr_create_task: refuses (fail-safe) rather than guessing when the duplicate's agent state cannot be classified confidently
ok - fm_backend_herdr_create_task: creates the replacement tab BEFORE closing the husk tab, never the reverse
ok - fm_backend_herdr_create_task: creates a tab and parses tab_id/pane_id from the JSON response, prunes nothing when no seeded tab id is given
ok - fm_backend_herdr_create_task: tab create passes --no-focus
ok - herdr presentation: a home that set nothing gets the projection by default at or above the floor
ok - herdr presentation: an unconfigured home below the floor falls back flat with one naming warning
ok - herdr presentation: an unreadable client release falls back flat instead of guessing
ok - herdr presentation: a deliberate opt-in is never silently downgraded below the floor
ok - herdr presentation: an explicit off opts the home out
ok - herdr presentation: an unrecognized value warns and follows the default instead of failing a spawn
ok - herdr presentation: the below-floor warning is one per home per release, not one per spawn
ok - herdr presentation: warning marker publication is atomic, symlink-safe, and fails visible
ok - herdr presentation: client and selected server floors compose conservatively without overriding explicit opt-in
ok - herdr presentation floor: every measured release, and each signal alone, classifies correctly
ok - herdr presentation floor: either signal alone can carry an above verdict, and each divergence is real
ok - herdr presentation: config parsing separates a deliberate choice from an unconfigured default
ok - herdr presentation journal: atomically publishes one non-authoritative 128-bit correlator and refuses overwrite
ok - herdr presentation journal: version 2 binds exact home/endpoint/parent identities and advances atomically
ok - herdr presentation create: exact response IDs yield one normal task pane with no workspace-close authority
ok - herdr presentation create: concurrent same-label tabs are never prune targets
ok - herdr presentation focus: snapshot requires one exact active workspace and tab
ok - herdr presentation focus: exact pane close restores the exact prior workspace and tab
ok - herdr presentation focus: cleanup refuses rather than close the captain's active tab
ok - herdr presentation focus: pane close fails when exact focus restoration fails
ok - herdr presentation reclaim: live agent state at the close boundary refuses mutation
ok - herdr presentation cleanup: emptying close behind focus ends the exact shell without a move or focus change
ok - herdr presentation cleanup: emptying close before focus moves the doomed workspace to the end and ends its exact shell
ok - herdr presentation cleanup: emptying close with the focused workspace last skips the move
ok - herdr presentation cleanup: emptying close of the last workspace skips the move
ok - herdr presentation cleanup: a non-emptying close stays plain with no proof, move, or signal
ok - herdr presentation cleanup: no-move plain close requires structured pane removal
ok - herdr presentation cleanup: an ambiguous workspace layout falls back to the plain close
ok - herdr presentation cleanup: a failed repositioning move falls back to the plain close with a warning
ok - herdr presentation cleanup: a pane with a live foreground process falls back to the plain close
ok - herdr presentation cleanup: a transient prompt helper settles into the pane-death path instead of the plain close
ok - herdr presenta

... [3349 bytes truncated] ...

ibling home's
ok - fm_backend_herdr_parse_target: splits '<session>:<pane_id>' on the FIRST colon (pane_id itself contains one)
ok - fm_backend_herdr_normalize_key: Enter/Escape/C-c map to herdr's verified enter/escape/ctrl+c
ok - fm_backend_herdr_capture: calls 'pane read <pane> --source recent --lines N' with the session set
ok - fm_backend_herdr_capture: works around the verified small-N '--lines' bug by over-fetching and trimming locally
ok - fm_backend_herdr_capture: ensures the session and preserves pane read failure
ok - fm_backend_herdr_send_key: normalizes the key and targets the right pane
ok - fm_backend_herdr_kill: calls pane close and stays best-effort on failure
ok - fm_backend_herdr_current_path: reads pane foreground_cwd (the live running process), not the frozen creation-time cwd
ok - fm_backend_herdr_busy_state: working -> busy
ok - fm_backend_herdr_busy_state: done -> idle, blocked -> idle (surfaced like a stale pane, not suppressed as busy)
ok - fm_backend_herdr_busy_state: unparseable/absent agent state reports unknown, the regex-fallback cue
ok - fm_backend_herdr_composer_state: a bare '❯' composer row reads empty
ok - fm_backend_herdr_composer_state: bright placeholder-like text stays pending rather than being mistaken for an idle ghost
ok - fm_backend_herdr_composer_state: real composer text reads pending
ok - fm_backend_herdr_composer_state: a slash-command popup's argument-hint placeholder still reads pending (the incident fix)
ok - fm_backend_herdr_composer_state: reports unknown when the pane cannot be captured
ok - fm_backend_herdr_composer_state: reports unknown for bare shell prompts with no composer row
ok - fm_backend_herdr_composer_state: a native idle Pi separator composer reads empty
ok - fm_backend_herdr_composer_state: real Pi composer text remains pending
ok - fm_backend_herdr_composer_state: an incomplete lower Pi separator cannot inherit a stale empty row
ok - fm_backend_herdr_composer_state: Pi separators never authorize working, non-Pi, unreadable, or over-tall targets
ok - fm_backend_herdr_composer_state: a real-claude unbordered '❯' prompt row (no border box in view) reads empty
ok - fm_backend_herdr_composer_state: a real-claude unbordered '❯ <text>' prompt row reads pending
ok - fm_backend_herdr_composer_state: a live unbordered prompt row below a stale bordered decorative box still wins (not misread as the box's own row)
ok - fm_backend_herdr_composer_state: claude's dim prompt-suggestion ghost (the overnight wedge shape) reads empty
ok - fm_backend_herdr_composer_state: real typed text on the same claude prompt row still reads pending
ok - fm_backend_herdr_composer_state: grok's dark-truecolor placeholder (the TRUECOLOR gap) reads empty
ok - fm_backend_herdr_composer_state: grok's real bright typed input still reads pending
ok - fm_backend_herdr_composer_state: a real-codex unbordered '›' prompt row reads empty
ok - fm_backend_herdr_composer_state: a faint real-codex ghost suggestion reads empty
ok - fm_backend_herdr_composer_state: non-faint codex prompt text still reads pending
ok - fm_backend_herdr_wait_for_working: reports 'busy' immediately on the first poll, without spending the rest of the budget
ok - fm_backend_herdr_wait_for_working: a slow transition landing on a later sample within one window is still caught (robust against the 'slow transition' failure direction)
ok - fm_backend_herdr_wait_for_working: spreads six samples across the full budget endpoint without a final trailing sleep
ok - fm_backend_herdr_send_text_submit: applies the herdr minimum confirmation budget before polling agent-state
ok - fm_backend_herdr_wait_for_working: reports 'idle' (readable, genuinely not yet working) when 'busy' never appears
ok - fm_backend_herdr_wait_for_working: reports 'unknown' (a hard read failure, not a timing race) only when EVERY poll in the window fails
ok - fm_backend_herdr_wait_for_working: treats blocked as submit-active for confirmation without changing watcher busy-state semantics
ok - fm_backend_herdr_send_text_submit: reports 'empty' once agent_status reports working after one Enter, without ever reading the composer
ok - fm_backend_herdr_send_text_submit: reports 'pending' when agent_status never reports working after retried Enters (swallowed)
ok - fm_backend_herdr_send_text_submit: a slash-command popup's placeholder fill on Enter #1 never flips agent_status to working, so it does not short-circuit as submitted; Enter #2 is retried and lands it
ok - fm_backend_herdr_send_text_submit: a post-Enter blocked state confirms delivery without retrying into the prompt
ok - fm_backend_herdr_send_text_submit: preexisting working is not accepted as submit proof when the composer still holds the message
ok - fm_backend_herdr_composer_state: cursor's mid-turn placeholder-plus-busy-token row reads pending (why delivery needs a separate signal)
ok - fm_backend_herdr_rendered_busy_state: busy/idle/unknown from the rendered footer, with an unreadable pane never reading idle
ok - fm_backend_herdr_send_text_submit: a rendered-footer idle-to-busy transition confirms delivery when native agent-state never reports idle
ok - fm_backend_herdr_send_text_submit: an already-busy footer baseline is never accepted as proof that this Enter landed
ok - fm_backend_herdr_send_text_submit: confirms submission via native agent-state alone, immune to a codex-style dynamic idle-tip composer that would have misread as 'pending' under the old composer-based confirmation
ok - fm_backend_herdr_composer_state: a faint real-codex dynamic idle-tip composer row reads empty
ok - fm_backend_composer_state (herdr): the pre-injection empty-box guard still refuses a genuinely non-empty composer, unaffected by the submit-confirmation change
ok - fm_backend_herdr_send_text_submit: a slow transition landing on a later sample within one Enter's budget is confirmed WITHOUT sending a needless extra Enter
ok - fm_backend_herdr_send_text_submit: reports 'send-failed' when the literal send-text call itself errors
ok - fm_backend_herdr_send_text_submit: reports 'unknown' when the post-Enter agent-get read fails (never retries past an unreadable target)
ok - fm_backend_validate: herdr is a known backend (P2)
ok - fm_backend_busy_state: tmux (no native primitive) always reports unknown, preserving the P1 regex-only path
error: unknown backend 'bogus' (known: tmux herdr zellij orca cmux)
ok - fm_backend_composer_state dispatches every backend to its named thin classifier, unknown for unrecognized backends
ok - fm-peek/fm-send: explicit stale targets matching metadata use the recorded backend
ok - fm_backend_herdr_normalize_event routes through the shared record with an empty from_status
ok - fm_backend_herdr_escalation_marker keys the dedupe marker exactly like the watcher's .stale-<key>
ok - fm_backend_herdr_apply_transition: blocked dedupe starts only after explicit commit
ok - fm_backend_herdr_apply_transition: a working edge clears the marker so the next ->blocked re-escalates
ok - fm_backend_herdr_clear_transition removes task-owned dedupe state
ok - fm_backend_herdr_apply_transition: idle/done (defer) and unknown/empty (fallback) take no fast action
ok - fm_backend_herdr_wait_transition: a home with no herdr panes falls back to polling (rc 2)
ok - fm_backend_herdr_wait_transition: below-capability protocol/schema falls back to polling (rc 2)
ok - fm_backend_herdr_wait_transition: reconnect level-reconcile returns an uncommitted blocked pane
ok - fm_backend_herdr_wait_transition: subscribes before reconnect level-reconcile
ok - fm_backend_herdr_wait_transition: a still-blocked, already-escalated pane is not re-delivered on reconnect
ok - fm_backend_herdr_wait_transition: a streamed ->blocked edge returns the record sub-poll
ok - fm_backend_herdr_wait_transition: streamed working clears the marker, idle/done are deferred (clean timeout)
ok - fm_backend_herdr_wait_transition: a reader/subscribe failure falls back to polling (rc 2)
ok - fm_backend_herdr_wait_transition: Bash 3.2-safe bad-ack path closes fd 9 and removes its FIFO
ok - fm_backend_herdr_wait_transition: stock macOS Bash clean timeout closes fd 9 and returns 1

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 3 infos
  • ℹ️ bin/backends/herdr.sh:1935 - The treehouse-subshell proof (fm_backend_herdr_pane_idle_subshell_sample) is checked in a single sample, with no settle retry. The pane-shell proof retries for up to FM_BACKEND_HERDR_IDLE_SHELL_PROOF_POLLS samples because prompt helpers such as starship briefly appear as a second foreground process. fm-spawn --relaunch makes one fm_backend_agent_state read, so a prompt redraw during that read makes the subshell layout read 'alive' and the relaunch refuses. fm-control's wait loop re-polls and recovers, so the impact is limited to that one-shot read. Optional follow-up: reuse the same bounded retry.
  • ℹ️ bin/backends/herdr.sh:1974 - The subshell proof checks that the foreground shell has no children and that its ancestors are shells or treehouse. It does not check that those ancestors (the pane shell or the treehouse launcher) have no other children. A backgrounded or sibling opencode job under the pane shell would therefore still read agent-free. Normal launches run opencode as a child of the treehouse subshell (fm-spawn.sh:2254), so this needs an unusual manual layout. It is noted for completeness and does not block the change.
  • ℹ️ bin/backends/herdr.sh:2005 - Every 'live' verdict now costs an extra agent get call. When a genuinely live opencode is registered idle or done, fm_backend_herdr_pane_idle_shell_pid also runs its full retry loop (about 10 × 0.1s plus a CLI call and ps calls on each attempt) before the subshell sample fails. That adds roughly 1s or more to each agent_state read for idle opencode workers in the fm-watch paused rechecks, fleet snapshots, and the post-launch alive wait. The verdict stays correct. If this becomes noticeable, the fix is to run the single-sample shell check before the retrying one.
✅ **Test** - passed

✅ No issues found.

  • bash tests/fm-backend-herdr.test.sh: passed (rc=0), including the four new agent_state regression tests (stale idle/done reads dead, live idle opencode stays alive, the treehouse-subshell layout plus harness-parented/busy/non-opencode refusals, working/blocked never reclassified)
  • Before/after comparison: verdict-matrix.sh runs the test file's fake herdr CLI and fake ps harness against base 4159b40's bin/backends/herdr.sh and target 9431ebc's bin/backends/herdr.sh across 12 cases
  • Checked that bin/fm-backend.sh:894 sends Herdr agent_state to fm_backend_herdr_agent_state, the state that do_exit in bin/fm-control.sh waits on before it reports exit=unconfirmed
  • Read the diff to confirm fm_backend_herdr_pane_agent_state and fm_backend_herdr_pane_idle_shell_pid are unchanged and the new subshell proof prints no pid
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…free on Herdr

A hook-authority idle/done opencode whose pane is a lone idle shell now reads dead so exit and relaunch can proceed.

Working, blocked, live-foreground, and non-opencode agents keep their verdict.
…se subshell remains

The idle-shell proof now also accepts a lone idle shell reached only through shells and the treehouse launcher.

Verified read-only against a stuck live pane.
@Hozzy02
Hozzy02 merged commit d56df70 into main Sep 25, 2026
13 checks passed
@Hozzy02
Hozzy02 deleted the fm/fm-herdr-opencode-stale-agent branch September 26, 2026 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant