Skip to content

fix: show Pi GLM and Codex task workers in Herdr agents sidebar - #25

Merged
doitdigital0495 merged 5 commits into
mainfrom
fm/fm-pi-herdr-sidebar-2026-09-23
Sep 24, 2026
Merged

doitdigital0495 merged 5 commits into
mainfrom
fm/fm-pi-herdr-sidebar-2026-09-23

Conversation

@doitdigital0495

@doitdigital0495 doitdigital0495 commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

Intent

Please also make sure that pi agents running glm or codex DO show in the agents sidebar

Context: "the agents sidebar" is Herdr's agent sidebar. Claude and Codex worker panes appear there (herdr agent list lists them), but Pi workers launched by Firstmate do not: their panes report agent_status: unknown and herdr agent explain <pane> returns agent_not_found. Herdr's Pi integration is installed and current (herdr integration status: pi v9, ~/.pi/agent/extensions/herdr-agent-state.ts), and the lean Pi launch in bin/fm-spawn.sh explicitly loads that extension with -e. Observed launch chain: sudo -n -E /usr/local/bin/op-broker run -f .env.op -- pi ..., which runs op run ... setpriv ... env -u XDG_CACHE_HOME -u XDG_CONFIG_HOME HOME=... PATH=... pi ....

What Changed

  • bin/fm-spawn.sh now wraps every Pi task-worker launch (Codex and zai/GLM) with best-effort herdr pane report-agent calls from inside the pane, under the firstmate:pi source. It reports working before launch, then idle or blocked based on the exit status. For zai, the wrapper covers the whole env-prefixed opr chain. The reports only run when HERDR_PANE_ID is set and herdr is on PATH, and a failed report never blocks the launch. The Pi task extension also reports working on agent_start and idle on agent_settled for the same pane, so a worker that stays open shows its real state.
  • Adds tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh, a live check that uses no API tokens. It runs the real fm-spawn.sh against an isolated Herdr lab session with fake Pi binaries, and checks that the GLM and Codex workers show up in herdr agent list as agent=pi and move from working to idle. tests/fm-spawn-dispatch-profile.test.sh now checks that the report wrapper is in the ship, GLM and scout launch lines.
  • docs/verification/runtime-backends.md explains why Pi workers were missing: the op-broker/sudo/setpriv chain moves the worker off the pane's pty, and the reserved herdr: source prefix never creates a record. It also records the fix and the live test result.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change is bounded: it adds best-effort Herdr telemetry that is guarded by HERDR_PANE_ID and never gates the launch. The earlier findings are fixed: the test now uses the repo's lab helper, the header comment matches the code, and the extension reports per-run state. The only gap left is that the new extension reporting has no test.

Testing

I ran the branch's live guard through fm-test-run on an isolated fm-lab Herdr session. It drives the real fm-spawn with a real opr chain, and both the GLM and Codex Pi worker panes showed up in herdr agent list as pi, going from working to idle. The launch-profile composition test also passed, but it is not a live drive, so that scenario is recorded as untested live. I then ran two adversarial scenarios live on a second lab session. A zai launch that exits non-zero went to blocked. A real interactive Pi TUI worker with the generated task extension settled to done after its turn while Pi was still open, so it does not stay at working. All labs were torn down and the worktree is clean. I captured no sidebar screenshot because the sidebar is a TUI and herdr agent list/agent get are its data source. Their JSON output is the evidence.

  • Live validation: ✅ go - 4 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Firstmate spawns a GLM (zai/glm-5.3, opr chain) Pi task worker on Herdr; its pane appears in herdr agent list as agent=pi, working then idle ✅ pass live tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh via fm-test-run (live-e2e-and-launch-profile.log)
Firstmate spawns a Codex (openai-codex/gpt-5.6-sol) Pi task worker on Herdr; its pane appears in herdr agent list as agent=pi, working then idle ✅ pass live tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh via fm-test-run (live-e2e-and-launch-profile.log)
Adversarial: a zai Pi worker whose launch exits non-zero ends as blocked in the sidebar, not stuck at working ✅ pass live adversarial-live.log scenario A: working, then blocked after rc=3; agent list row w1:p2 pi blocked
Adversarial (review-3): a real interactive Pi TUI worker finishes its turn and stays open; its Herdr status leaves working while the Pi process is still running ✅ pass live adversarial-live.log scenario B: working, then done while the pane still shows the live Pi TUI prompt/footer
Launch composition: pane-side report brackets wrap both the Codex and GLM Pi launches, with no ZAI key in the launch text ⏸️ untested no The prior payload established this only through the composition-level test tests/fm-spawn-dispatch-profile.test.sh, not a live drive against the running product, so it did not establish a live result.…
Evidence: Live Herdr e2e guard + launch profile test log

Source: Live Herdr e2e guard + launch profile test log

# zai Pi worker pane w1:p2 registered working then idle in isolated Herdr lab # Codex Pi worker pane w1:p3 registered working then idle in isolated Herdr lab ok - real fm-spawn + isolated Herdr lab: GLM and Codex Pi task workers appear in the agents sidebar with real agent_status

FM_TEST_BEGIN 2026-09-23T18:02:57Z tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh family=unclassified expected_gate_skip=none
# zai Pi worker pane w1:p2 registered working then idle in isolated Herdr lab
# Codex Pi worker pane w1:p3 registered working then idle in isolated Herdr lab
ok - real fm-spawn + isolated Herdr lab: GLM and Codex Pi task workers appear in the agents sidebar with real agent_status
FM_TEST_END 2026-09-23T18:03:37Z tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh exit=0 duration_ms=39118 gate_skip=false
FM_TEST_BEGIN 2026-09-23T18:03:37Z tests/fm-spawn-dispatch-profile.test.sh family=backend-dispatch expected_gate_skip=none
ok - allowlist=absent preserves the operational floor and filters only when opted in
ok - allowlist=missing-config preserves the operational floor and filters only when opted in
ok - allowlist=enabled preserves the operational floor and filters only when opted in
ok - allowlist=empty preserves the operational floor and filters only when opted in
ok - invalid allowlist names refuse before launch or task publication
ok - inaccessible config with present allowlist refuses before launch or task publication
ok - inaccessible config with absent allowlist refuses before launch or task publication
ok - inaccessible ancestor with present allowlist refuses before launch or task publication
ok - inaccessible ancestor with absent allowlist refuses before launch or task publication
ok - secondmate launch inherits the allowlist for subsequent worker launches
ok - local inheritance preserves the allowlist on source errors and mirrors proven absence
ok - remote inheritance preserves the allowlist on source errors and mirrors proven absence
ok - fm-spawn: actual ship/scout launch commands deliver the worker role contract
ok - no --model/--effort records defaults and types the claude launch instructions
ok - non-cursor launches clear inherited Cursor identity markers
ok - relative home overrides ignore CDPATH and become absolute before spawn launch construction
ok - FM_HOME defaults resolve relative paths and preserve absolute spellings
ok - absolute override spellings are preserved in spawn launch paths
ok - unresolvable relative spawn overrides fail with named diagnostics
ok - active crew-dispatch profile requires an explicit harness for ship spawns
ok - active crew-dispatch profile requires an explicit harness for scout spawns
ok - active crew-dispatch profile allows an explicit resolved harness
ok - active crew-dispatch profile allows the legacy positional harness form
ok - active crew-dispatch profile allows the raw launch-command escape hatch
ok - claude receives --model and --effort profile flags
ok - codex receives --model and model_reasoning_effort profile flags
ok - codex Luna receives --model and model_reasoning_effort max profile flags
ok - codex omits max for models without the catalog capability
ok - a codex crewmate launches with no hook layer and keeps its turn-end signal
ok - a codex secondmate keeps the project hook layer its primary session runs on
ok - grok receives --model and --reasoning-effort profile flags
ok - grok omits unsupported max reasoning effort
ok - grok omits unsupported xhigh reasoning effort
ok - cursor receives its model-qualified reasoning class and exact task workspace
ok - cursor refuses model ids absent from its resolved binary's live catalog
ok - cursor preserves the requested model when its live catalog is unreachable
ok - opencode receives --model and omits the unsupported effort axis
ok - native effort validator checks harness and model as separate axes
ok - Ultra is explicit for native Pi and Pi-signed, including direct-PR, and refuses unsupported profiles before provisioning
ok - batch dispatch preserves native Ultra in metadata and launch flags
ok - pi receives --model and --thinking max profile flags
ok - Pi workers pin lean resources, tools, model, thinking, and environment-independent defaults
ok - Pi GLM workers use opr, hide the key, and enforce the installed reasoning map
ok - Pi scouts receive read-only tools and pane-side Herdr registration
ok - Pi workers refuse before launch when an operator extension is missing
ok - raw Pi launches keep the captain's command and record no invented profile
ok - Pi launch probing omits --tui-mode on older Pi and preserves it on supporting Pi
ok - pi-signed shares Pi launch semantics while preserving its configured and recorded identity
ok - pi-signed refuses safely and actionably when the selected executable is unavailable
ok - pi-signed is a distinct persistent secondmate runtime with shared Pi supervision semantics
ok - batch dispatch forwards shared --harness, --model, and --effort to every pair
ok - claude forwards firstmate's CLAUDE_CONFIG_DIR so the crewmate uses the same credential store
ok - claude pins the single-store default by unsetting any inherited config dir
ok - config/claude-permission-mode=bypass launches exactly as an absent file does
ok - config/claude-permission-mode=auto replaces --dangerously-skip-permissions with --permission-mode auto
ok - config/claude-permission-mode=auto reaches scout launches too
ok - an unrecognized config/claude-permission-mode token refuses before any endpoint or metadata
ok - config/claude-permission-mode changes claude launches only
ok - non-claude harnesses do not receive the claude CLAUDE_CONFIG_DIR prefix
ok - a claude task launch establishes only Firstmate's task control channels through the system prompt
ok - a persistent claude secondmate keeps its supervisor contract without a task-worker authority overlay
ok - fm-spawn: a Claude launch longer than 1024 bytes is delivered intact through the staging path
ok - a claude crewmate launch carries the attribution-off policy in its own settings
ok - a claude secondmate launch carries the attribution-off policy too
ok - active crew-dispatch profile does not block secondmate launches
# all fm-spawn-dispatch-profile tests passed
FM_TEST_END 2026-09-23T18:06:13Z tests/fm-spawn-dispatch-profile.test.sh exit=0 duration_ms=156044 gate_skip=false
FM_TEST_SUMMARY total=2 failed=0 skipped_gate=0 duration_ms=195232
FM_TEST_SUMMARY_FAMILY family=backend-dispatch count=1 duration_ms=156044 failed=0
FM_TEST_SUMMARY_FAMILY family=unclassified count=1 duration_ms=39118 failed=0
FM_TEST_SLOWEST rank=1 script=tests/fm-spawn-dispatch-profile.test.sh duration_ms=156044
FM_TEST_SLOWEST rank=2 script=tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh duration_ms=39118
Evidence: Adversarial live scenarios log (blocked on failure; real interactive Pi settles)

Source: Adversarial live scenarios log (blocked on failure; real interactive Pi settles)

A pane w1:p2 while running: {"agent":"pi","agent_status":"working"} A pane w1:p2 after rc=3 exit: {"agent":"pi","agent_status":"blocked"} B pane w1:p3 start: {"agent":"pi","agent_status":"working"} B status after turn, Pi TUI still open: {"agent":"pi","agent_status":"done"}

=== Scenario A: failing zai Pi launch ends blocked ===
A pane w1:p2 while running: {"agent":"pi","agent_status":"working"}
A pane w1:p2 after rc=3 exit: {"agent":"pi","agent_status":"blocked"}
[{"pane_id":"w1:p2","agent":"pi","agent_status":"blocked"}]
=== Scenario B: interactive real Pi worker goes idle while still open ===
B launch: 
B pane w1:p3 start: {"agent":"pi","agent_status":"working"}
B FAIL: stayed {"agent":"pi","agent_status":"done"}
B status 3s later: {"agent":"pi","agent_status":"done"}
B pi still running in pane (process list):
{"pane":{"agent":"pi","agent_session":{"agent":"pi","kind":"path","source":"herdr:pi","value":"~/.pi/agent/sessions/--home-daan-.treehouse-project-1c788e-2-project--/2026-09-23T18-07-42-035Z_01a0cf73-b5d3-76be-9580-460c10c6b3e0.jsonl"},"agent_status":"done","cwd":"/tmp/fm-pi-adv.8eBep5/project","focused":false,"foreground_cwd":"~/.treehouse/project-1c788e/2/project","pane_id":"w1:p3","revision":3,"scroll":{"max_offset_from_bottom":40,"offset_from_bottom":0,"viewport_rows":40},"tab_id":"w1:t3","terminal_id":"term_65c2a5bc480cf3","terminal_title":"π - project","terminal_title_
--- B pane screen ---
 specification, not captain intent.
 The Definition of done's rule that --intent must be self-sufficient still governs the string you pass: resolve any
 report, decision, or PR the intent below refers to into its substance rather than passing the pointer.

 Captain intent authorized for --intent

 Say hi.


────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 Update Available
 New version 0.87.1 is available. Run pi update
 Changelog: https://pi.dev/changelog
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

 Error: OpenAI API error (401): {"message":"Incorrect API key provided: sk-fm-te******alid. You can find your API key
 at
 https://platform.openai.com/account/api-keys.","type":"invalid_request_error","code":"invalid_api_key","param":null}
 If this looks like a pi bug, /bug sends a report to the developers.

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
~/.treehouse/project-1c788e/2/project (detached)
0.5%/128k (auto)                                                                                    (openai) gpt-4o-mini
Evidence: Adversarial scenario driver script

Source: Adversarial scenario driver script

#!/usr/bin/env bash
# Live adversarial scenarios for the Pi Herdr sidebar change, on an isolated lab.
# A: a Pi task worker whose launch fails must end "blocked", not stuck "working".
# B: an interactive (Codex-path, --tui-mode regular) REAL Pi worker that finishes
#    its turn and stays open must flip to "idle" via the task extension, while
#    the Pi process is still running.
set -u
ROOT=${ROOT:?}
# Same scratch-sandbox harness contract as the repo's own live tests.
. "$ROOT/tests/lib.sh"
LAB="$ROOT/bin/fm-herdr-lab.sh"
SESSION=$("$LAB" name fm-pi-adv)
export HERDR_SESSION="$SESSION"
SCRATCH=$(mktemp -d "${TMPDIR:-/tmp}/fm-pi-adv.XXXXXX")
WTS=()
cleanup() {
  for w in "${WTS[@]}"; do treehouse return --force "$w" >/dev/null 2>&1; done
  "$LAB" teardown "$SESSION"
  rm -rf "$SCRATCH"
}
trap cleanup EXIT
"$LAB" provision "$SESSION" || { echo "provision failed"; exit 1; }
lab() { "$LAB" run "$SESSION" "$@"; }
REALPI=$(command -v pi)

PROJ="$SCRATCH/project"; mkdir -p "$PROJ"
git -C "$PROJ" init -q; echo x > "$PROJ/README.md"; git -C "$PROJ" add README.md
git -C "$PROJ" -c user.name=t -c user.email=t@example.invalid commit -qm init
git clone -q --bare "$PROJ" "$PROJ.origin.git"; git -C "$PROJ" remote add origin "file://$PROJ.origin.git"
HOME_DIR="$SCRATCH/fm-home"; mkdir -p "$HOME_DIR"/{state,config,projects,data}
echo off > "$HOME_DIR/config/herdr-presentation-spaces"

spawn() { # <id> <fakebin> <model> <effort>
  mkdir -p "$HOME_DIR/data/$1"
  printf '# Task\n## Captain'"'"'s intent\nSay hi.\n\n## Firstmate spec\nReply "hi" only.\n' > "$HOME_DIR/data/$1/brief.md"
  env -u HERDR_ENV -u HERDR_PANE_ID -u HERDR_SOCKET_PATH PATH="$2:$PATH" \
    FM_SPAWN_NO_GUARD=1 FM_HOME="$HOME_DIR" FM_ROOT_OVERRIDE="$ROOT" \
    "$ROOT/bin/fm-spawn.sh" "$1" "$PROJ" --harness pi --model "$3" --effort "$4" \
    --mode no-mistakes --yolo off --backend herdr >"$SCRATCH/$1.out" 2>"$SCRATCH/$1.err" \
    || { echo "spawn $1 failed"; tail -20 "$SCRATCH/$1.err"; return 1; }
  PANE=$(grep '^herdr_pane_id=' "$HOME_DIR/state/$1.meta" | cut -d= -f2-)
  WTS+=("$(grep '^worktree=' "$HOME_DIR/state/$1.meta" | cut -d= -f2-)")
}
status() { lab agent get "$PANE" 2>/dev/null | jq -c '.result.agent | {agent, agent_status}' 2>/dev/null; }
waitfor() { local i=0; while [ $i -lt 120 ]; do [ "$(lab agent get "$PANE" 2>/dev/null | jq -r '.result.agent.agent_status // empty')" = "$1" ] && return 0; sleep 0.5; i=$((i+1)); done; return 1; }

echo "=== Scenario A: failing zai Pi launch ends blocked ==="
FB1="$SCRATCH/fb-fail"; mkdir -p "$FB1"
cat > "$FB1/pi" <<'SH'
#!/usr/bin/env bash
[ "${1:-}" = --help ] && { printf '%s\n' 'Pi 0.86.1 (fake)' 'Options: --help --tui-mode <mode>'; exit 0; }
sleep 6; exit 3
SH
chmod +x "$FB1/pi"
spawn fail-e2e "$FB1" zai/glm-5.3 high || exit 1
waitfor working && echo "A pane $PANE while running: $(status)" || echo "A FAIL: never working: $(status)"
waitfor blocked && echo "A pane $PANE after rc=3 exit: $(status)" || echo "A FAIL: not blocked: $(status)"
lab agent list 2>/dev/null | jq -c --arg p "$PANE" '[.. | objects | select(.pane_id? == $p) | {pane_id, agent, agent_status}] | unique' 2>/dev/null

echo "=== Scenario B: interactive real Pi worker goes idle while still open ==="
FB2="$SCRATCH/fb-real"; mkdir -p "$FB2"
# Real pi, real task extension and TUI; only the provider is swapped to an
# unauthenticated one so the turn errors out instantly and spends no tokens.
cat > "$FB2/pi" <<SH
#!/usr/bin/env bash
[ "\${1:-}" = --help ] && exec "$REALPI" --help
args=(); skip=0
for a in "\$@"; do
  if [ \$skip = 1 ]; then skip=0; continue; fi
  case "\$a" in --provider|--model|--thinking) skip=1; continue;; esac
  args+=("\$a")
done
exec "$REALPI" "\${args[@]}" --provider openai --model gpt-4o-mini --api-key sk-fm-test-invalid
SH
chmod +x "$FB2/pi"
spawn codex-live-e2e "$FB2" openai-codex/gpt-5.6-sol medium || exit 1
echo "B launch: $(grep -o -- '--tui-mode [a-z]*' "$HOME_DIR/state/codex-live-e2e.meta" "$SCRATCH/codex-live-e2e.out" 2>/dev/null | head -1)"
waitfor working && echo "B pane $PANE start: $(status)" || echo "B FAIL: never working: $(status)"
waitfor idle && echo "B pane $PANE after turn settled: $(status)" || echo "B FAIL: stayed $(status)"
sleep 3
echo "B status 3s later: $(status)"
echo "B pi still running in pane (process list):"
lab pane get "$PANE" 2>/dev/null | jq -c '.result' 2>/dev/null | head -c 600; echo
pgrep -af "sk-fm-test-invalid" | grep -v pgrep | head -2 | cut -c1-160
echo "--- B pane screen ---"
lab pane read "$PANE" 2>/dev/null | tail -25

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ⚠️ tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh:44 - New live test hardcodes the helper path HERDR_LAB_HELPER=&#39;~/.firstmate/bin/fm-herdr-lab.sh&#39; (tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh:44). It points at a different checkout, not the repo under test. On any other machine or home, provision fails and the test reports not ok. On this machine it runs whatever helper version sits in ~/.firstmate, not the one on this branch, so the isolation guarantee the test cites (bin/fm-herdr-lab.sh owns isolation) is not checked against this tree. Every sibling Herdr e2e test uses ${HERDR_LAB_HELPER:-$ROOT/bin/fm-herdr-lab.sh}, and bin/fm-herdr-lab.sh exists in the repo. Fix: use that same form.
  • ℹ️ bin/fm-spawn.sh:189 - The header usage comment in bin/fm-spawn.sh:189-192 says only the zai launch is bracketed with Herdr reports ("A zai launch adds only opr ... and brackets that env-prefixed launch"). The code at bin/fm-spawn.sh:5130 brackets every Pi task worker, Codex included, and the inline comment and the docs say the same. Reword the header so it matches the code.

🔧 Fix applied.
2 issues (1 warning, 1 info) still open:

  • ℹ️ bin/fm-spawn.sh:189 - The header usage comment in bin/fm-spawn.sh:189-192 says only the zai launch is bracketed with Herdr reports ("A zai launch adds only opr ... and brackets that env-prefixed launch"). The code at bin/fm-spawn.sh:5130 brackets every Pi task worker, Codex included, and the inline comment and the docs say the same. Reword the header so it matches the code.
  • ⚠️ bin/fm-spawn.sh:5093 - The pane-side bracket reports working only once, before launch, and idle/blocked only after the Pi process exits. That fits the zai path, where the docs say Pi falls back to print mode under op run and exits after its run. It does not fit a Pi task worker that stays in its interactive TUI (--tui-mode regular, the Codex path with no opr). Once such a worker finishes its turn and sits idle at its prompt, Herdr keeps showing firstmate:pi working until the process exits. Nothing corrects that unless Pi's own herdr-agent-state extension reports and Herdr prefers its state, and the intent says that extension is silent. The live test uses a sleeping fake Pi, so it cannot show this.

The stuck state also feeds Firstmate's own consumers of Herdr agent state, not just the sidebar label. Concrete sequence: a Codex Pi worker is idle at its prompt and the captain steers it via fm_backend_herdr_send_text_submit (bin/backends/herdr.sh:3281-3343). The raw baseline is working, so the idle-baseline path is skipped. _fm_composer_pi_verdict now has identity pi, so a swallowed line classifies pending where it used to be unknown. Once retries run out, fm_composer_queued_enter_verdict gets busy from fm_backend_herdr_queued_enter_busy (herdr.sh:3265) and turns that pending into empty. The steer is reported as delivered even though it was swallowed. Before this change, agent_not_found gave raw status '' and the result was pending, or unknown at the first composer read.

Other consumers of the same stuck status:

  • fm_backend_herdr_busy_state (herdr.sh:3498) returns busy.
  • fm-busy-lib.sh:941 reports busy herdr-native when no turn record exists.
  • fm-pending-reply-lib.sh:790 reads the same native state.
  • The seeded-tab prune guard (herdr.sh:1890) treats the pane as actively working.

Possible remedies:

  • Bracket only the zai/opr launch, where Pi really runs one-shot and detached.
  • Have the Pi task extension report per-turn states under the same firstmate:pi source.

This needs the author's call because it changes which launches get reports.

🔧 Fix applied.
1 info still open:

  • ℹ️ docs/verification/runtime-backends.md:144 - Round 3 fixed review-3 by adding per-run firstmate:pi reports to the Pi task extension (bin/fm-spawn.sh:4619-4636). The verification doc now says an idle interactive worker reports idle through that extension. Nothing checks that claim. The live guard uses sleeping fake Pi executables, so the working to idle transition it asserts comes only from the wrapper's post-exit report (bin/fm-spawn.sh:5106). None of the round-3 changes run the generated extension's agent_start or agent_settled handlers. If the handlers never fire, or herdr is not on the extension's PATH, the idle-at-prompt case still shows working, the sidebar mislabel from review-3 returns, and no test fails. Fix: either mark that sentence as not live-verified, or extend the live guard so a fake Pi runs the generated extension's handlers and the test asserts the extension's idle report arrives while the process is still alive.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 4 of 5 scenarios driven live against the product
Scenario Result Live Evidence
Firstmate spawns a GLM (zai/glm-5.3, opr chain) Pi task worker on Herdr; its pane appears in herdr agent list as agent=pi, working then idle ✅ pass live tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh via fm-test-run (live-e2e-and-launch-profile.log)
Firstmate spawns a Codex (openai-codex/gpt-5.6-sol) Pi task worker on Herdr; its pane appears in herdr agent list as agent=pi, working then idle ✅ pass live tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh via fm-test-run (live-e2e-and-launch-profile.log)
Adversarial: a zai Pi worker whose launch exits non-zero ends as blocked in the sidebar, not stuck at working ✅ pass live adversarial-live.log scenario A: working, then blocked after rc=3; agent list row w1:p2 pi blocked
Adversarial (review-3): a real interactive Pi TUI worker finishes its turn and stays open; its Herdr status leaves working while the Pi process is still running ✅ pass live adversarial-live.log scenario B: working, then done while the pane still shows the live Pi TUI prompt/footer
Launch composition: pane-side report brackets wrap both the Codex and GLM Pi launches, with no ZAI key in the launch text ⏸️ untested no The prior payload established this only through the composition-level test tests/fm-spawn-dispatch-profile.test.sh, not a live drive against the running product, so it did not establish a live result.…
  • bin/fm-test-run.sh tests/fm-pi-zai-herdr-agent-report-live-e2e.test.sh tests/fm-spawn-dispatch-profile.test.sh
  • ROOT=$PWD bash ~/.no-mistakes/evidence/01M37P82SKXQ1DDBPMC1Q70ZG5/drive-adversarial.sh (scenario A: real fm-spawn zai worker whose Pi exits rc=3 in an isolated fm-lab Herdr session)
  • same driver, scenario B: real fm-spawn Codex-path worker running the REAL Pi 0.86.1 TUI with its generated task extension (provider swapped to an invalid OpenAI key so no tokens are spent), status read via herdr agent get / pane get / pane read while Pi stayed open
  • checked that the worktree is clean and no fm-lab-* sessions remain after teardown
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

… 9", by updating one stale test expectation in `tests/fm-spawn-pi-skill.test.sh`. **Cause:** `test_default_launch_is_unchanged` compares the full Pi worker launch command against an exact copy. This PR now wraps every Pi task worker launch in Herdr pane reports: a `working` report before launch, and an `idle` or `blocked` report after exit, based on the exit code. The saved copy still showed the old, unwrapped command, so the comparison failed. The sibling checks in `tests/fm-spawn-dispatch-profile.test.sh` only check that parts of the command are present, and they were already updated earlier in this PR. **Rule it broke:** the saved copy must match the launch command `bin/fm-spawn.sh` actually generates. It is the only exact-copy test of the Pi launch line. **Fix:** the expected string now includes the Herdr report before the launch and the exit-status report after it, taken exactly from the generated output. I made no changes outside the test. **Checks run:** - `tests/fm-spawn-pi-skill.test.sh`: all tests pass. - `tests/fm-spawn-dispatch-profile.test.sh`: all tests pass. - `shellcheck` shows only the SC1091 info note that was already there. **Not fixed:** locally, `tests/fm-kimi-harness.test.sh` also fails one case: "Kimi hook install refused a realistic config". That test covers Kimi hook installation, which this PR doesn't touch, and it wasn't in the failing CI shard. It most likely depends on this machine's setup, so I left it alone
@doitdigital0495
doitdigital0495 merged commit 4037b33 into main Sep 24, 2026
19 checks passed
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.

2 participants