Skip to content

fix(bin): restore Claude slash-command submission on Herdr - #6695

Merged
kunchenguid merged 8 commits into
kunchenguid:mainfrom
AokDesu:fm/fm-herdr-slash-popup
Nov 4, 2026
Merged

kunchenguid merged 8 commits into
kunchenguid:mainfrom
AokDesu:fm/fm-herdr-slash-popup

Conversation

@AokDesu

@AokDesu AokDesu commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Refresh the open upstream pull request #6695 so it can merge: "can we go refresh the PRs for him? #6695", and "you can use grok to refresh the PR". The validation runs on ChatGPT Sol high for this run only, and the other open pull request, #7344, is left as it is.

What the maintainer asked (Kun's firstmate, 2026-10-25, #6695 (comment)): its verdict on the fix is unchanged (contract-class restore, it covers the most popup shapes, three independent field confirmations); the approved CI and no-mistakes runs from Oct 6 never got a runner and will not start, so bring the branch up to date with main and re-push through no-mistakes, giving a fresh head plus its attestation. Once green and attested it is eligible to merge, and the overlapping #7388 and #6813 would close.

The fix itself, as originally asked: "Before you fix the firstmate bug you can do updatefirstmate command first then if there is still a bug you can go fix it right away."
The bug, as it was reported (first seen on 2026-10-06 with Claude Code 2.1.291): firstmate cannot type a command that starts with / into a Claude worker running on the Herdr backend. While the command is typed, Claude shows its slash-command suggestion list under the input box; firstmate's safety check reads that list as leftover typed text and backs out without submitting. So stopping or restarting a worker (bin/fm-control.sh <id> exit|relaunch, which fails with "the exit command could not be sent to task on herdr") and starting validation by sending /no-mistakes through bin/fm-send.sh both fail.
"Does it already fixed yet? If it already fixed we should close the PR. Re-test the bug on this version please maybe it fixed." (Re-tested 2026-10-10 on Claude Code 2.1.296: still broken on main and fixed by the PR; later field reports confirm the same on 2.1.304 and 2.1.309.)
"1 more thing I want you to make sure that does it becuase I ran claude code on herdr that make you can't do exit command." (The failure is specific to Herdr; tmux is unaffected.)

What Changed

  • Recognize Claude’s marked slash-command suggestion rows separately from the composer, restoring slash-command submission on Herdr while preserving partial-payload refusals.
  • Add real Claude Code 2.1.291 captures and regression coverage for popup variants, composer reads, and submission checks.
  • Extend the live Herdr guard with /context delivery checks and document the popup detection rules, verification results, and limitations.

Risk Assessment

⚠️ Medium: The bounded fix preserves refusal behavior, but named Claude sessions can still encounter the original slash-command submission failure.

Testing

Targeted composer and Herdr suites passed, including historical popup and refusal guards. Live Claude 2.1.310 checks on Herdr 0.9.1 and tmux passed after correcting disposable fixture setup. Terminal captures, HTML, screenshot, and command transcripts were retained; the worktree is clean. /no-mistakes was inspected without executing another pipeline.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Send /context through fm-send on Herdr; its Context Usage report renders and Claude remains registered. ✅ pass live manual-live-fixed.log; terminal-evidence.html
Stop Claude through fm-control exit on Herdr; the agent exits and its pane remains. ✅ pass live manual-live-fixed.log; manual-exited.txt
Type / and /no-mistakes; content reads return exactly the draft and state remains pending despite the marked popup row. ✅ pass live manual-live-fixed.log; manual-slash.ansi; manual-slashno-mistakes.ansi
Attempt another send over a pending /no-mistakes draft; submission is refused and the visible draft remains unchanged. ✅ pass live manual-live-fixed.log
Use a shell-backed tmux worker; /context renders its report and fm-control exit stops Claude. ✅ pass live tmux-live-worker.log; tmux-context-report.txt
Submit ordinary and U+2063 operational prompts on Herdr; Claude renders both requested replies. ✅ pass live ~/.no-mistakes/evidence/01M5W4BVV35QDEMTPR1Y1SJ8PZ/live-submit.log
Evidence: Popup, context report, and exit evidence

Source: Popup, context report, and exit evidence

<!doctype html><html><meta charset="utf-8"><title>Live Claude terminal evidence</title><style>body{margin:0;padding:24px;background:#111317;color:#e8e8e8;font:15px system-ui}h1{font-size:23px}h2{font-size:18px;margin-bottom:6px}p{color:#a7adb8}section{margin:28px 0}pre{background:#181b20;border:1px solid #383e48;padding:18px;overflow:auto;font:13px/1.45 monospace;white-space:pre}a{color:#8dc5ff}</style><h1>Live Claude terminal evidence</h1><p>Captured from isolated named Herdr labs during this test run. Terminal output is rendered directly from captures.</p><section><h2>Typed /no-mistakes stays pending</h2><p>Herdr 0.9.1 · Claude Code 2.1.310 · command was inspected, never executed</p><pre><span style="color:#dedede;font-weight:400;opacity:1">CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false CLAUDE_CODE_SEND_FEEDBACK=0 claude --dangerously-skip-permissions --settings 
&#x27;{&quot;disableAllHooks&quot;:true,&quot;feedbackDrafts&quot;:&quot;off&quot;}&#x27;

</span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#dedede;font-weight:700;opacity:1"></span><span style="color:#56b6c2;font-weight:700;opacity:1">01M5W4BVV35QDEMTPR1Y1SJ8PZ</span><span style="color:#dedede;font-weight:400;opacity:1"> </span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#56b6c2;font-weight:400;opacity:1">HEAD</span><span style="color:#dedede;font-weight:400;opacity:1"> </span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#56b6c2;font-weight:400;opacity:1">? </span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#dedede;font-weight:700;opacity:1"></span><span style="color:#56b6c2;font-weight:700;opacity:1">❯</span><span style="color:#dedede;font-weight:400;opacity:1"> CLAUDE_CODE_ENABLE_PROMPT_SUGGESTION=false CLAUDE_CODE_SEND_FEEDBACK=0 claude --dang
erously-skip-permissions --settings &#x27;{&quot;disableAllHooks&quot;:true,&quot;feedbackDrafts&quot;:&quot;off&quot;}&#x27;
 ▐▛███▛█   Claude Code v2.1.310
▝▜██████▀  Opus 5.5 with xhigh effort · Claude Pro
 ▝▝   ▝▝   ~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ


────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ /no-mistakes
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ❯ /no-mistakes                                    Validate your code changes through the no-mistakes pipeline -
                                                    automated code review, tests, lint, docs, push, PR, and CI - befo…</span></pre></section><section><h2>Submitted /context renders its report</h2><p>Actual scrollback excerpt captured after fm-send returned</p><pre><span style="color:#dedede;font-weight:400;opacity:1">❯ /context
  ⎿  Context Usage
     ⛀ ⛁ ⛁ ⛀ ⛀ ⛀ ⛁ ⛁ ⛁ ⛀ ⛁ ⛁ ⛀ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   Opus 5.5
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   claude-opus-5-5
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   44.1k/1m tokens (4%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   Estimated usage by category
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System prompt: 3k tokens (0.3%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ System tools: 11.3k tokens (1.1%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ MCP tools: 633 tokens (0.1%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶   ⛁ MCP server instructions: 1.3k tokens (0.1%)
     ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝ ⛝   ⛁ Custom agents: 314 tokens (0.0%)
                                               ⛁ Memory files: 17.5k tokens (1.8%)
                                               ⛁ Skills: 10k tokens (1.0%)
                                               ⛁ Messages: 10 tokens (0.0%)
                                               ⛶ Free space: 923k (92.3%)
                                               ⛝ Autocompact buffer: 33k tokens (3.3%)

     Auto-compact window: 1m tokens

     MCP tools · /mcp (loaded on-demand)

     Loaded
     ├ mcp__claude_ai_Claude_Docs__batch: 155 tokens
     ├ mcp__claude_ai_Claude_Docs__guide: 197 tokens
     └ mcp__claude_ai_Claude_Docs__update: 281 tokens

     Available
     ├ mcp__claude_ai_Claude_Docs__create
     ├ mcp__claude_ai_Claude_Docs__delete
     ├ mcp__claude_ai_Claude_Docs__export
     ├ mcp__claude_ai_Claude_Docs__query
     ├ mcp__claude_ai_Claude_Docs__read
     ├ mcp__claude_ai_Gmail__authenticate
     ├ mcp__claude_ai_Gmail__complete_authentication
     ├ mcp__claude_ai_Google_Calendar__authenticate
     ├ mcp__claude_ai_Google_Calendar__complete_authentication
     ├ mcp__claude_ai_Google_Drive__authenticate
     ├ mcp__claude_ai_Google_Drive__complete_authentication
     ├ mcp__plugin_context7_context7__authenticate
     ├ mcp__plugin_context7_context7__complete_authentication</span></pre></section><section><h2>Submitted /exit stops Claude</h2><p>Actual terminal capture after the live submit guard</p><pre><span style="color:#dedede;font-weight:400;opacity:1">     ├ schedule: ~130 tokens
     ├ run: ~120 tokens
     ├ loop: ~120 tokens
     ├ plugin-authoring: ~90 tokens
     ├ keybindings-help: ~80 tokens
     ├ artifact-diagramming: ~70 tokens
     ├ artifact-design: ~70 tokens
     ├ fewer-permission-prompts: ~60 tokens
     ├ simplify: ~60 tokens
     ├ security-review: &lt; 20 tokens
     └ init: &lt; 20 tokens

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ /exit
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ❯ /exit                                           Exit the CLI
    /edit-article                                   Edit and improve articles by restructuring sections, improving
                                                    clarity, and tightening prose. Use when user wants to edit, revis…
    /context                                        Visualize current context usage as a colored grid
    /usage-credits                                  Configure usage credits or request them from your admin when you
                                                    hit a limit
    /quiet                                          Enter quiet supervision mode when the captain invokes /quiet or
                                                    asks for quiet mode, quiet-while-present, or fewer routine wake t…













Resume this session with:
claude --resume db85599e-7b7c-4afd-a9ad-8616d3ee1d2d

</span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#dedede;font-weight:700;opacity:1"></span><span style="color:#56b6c2;font-weight:700;opacity:1">01M5W4BVV35QDEMTPR1Y1SJ8PZ</span><span style="color:#dedede;font-weight:400;opacity:1"> </span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#56b6c2;font-weight:400;opacity:1">HEAD</span><span style="color:#dedede;font-weight:400;opacity:1"> </span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#56b6c2;font-weight:400;opacity:1">? </span><span style="color:#dedede;font-weight:400;opacity:1"></span><span style="color:#dedede;font-weight:700;opacity:1"></span><span style="color:#56b6c2;font-weight:700;opacity:1">❯</span><span style="color:#dedede;font-weight:400;opacity:1"></span></pre></section></html>
Evidence: Herdr user commands and overwrite refusal

Source: Herdr user commands and overwrite refusal

~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.test-slash-popup/manual-home-fixed
typed=/ state=pending content=/
typed=/no-mistakes state=pending content=/no-mistakes
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.test-slash-popup/manual-home-fixed
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the requested message WILL still be sent.
●  repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
error: text not sent to fm-lab-slash-manual-570669-31387:w1:p1 (herdr send failed; tried meta=~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.test-slash-popup/manual-home-fixed/state/slash-live.meta; backend=from-meta)
fm-send refused an overwrite of the pending slash draft
pending /no-mistakes draft unchanged; no command executed
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.test-slash-popup/manual-home-fixed
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
fm-send slash-live /context: rendered Context Usage; registered agent survives
{"id":"cli:agent:get","result":{"agent":{"agent":"claude","agent_status":"working","cwd":"~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ","focused":true,"foreground_cwd":"~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ","pane_id":"w1:p1","revision":2,"state_change_seq":2,"tab_id":"w1:t1","terminal_id":"term_65ebdf930288e1","terminal_title":"✳ Claude Code","terminal_title_stripped":"Claude Code","workspace_id":"w1"},"type":"agent_info"}}
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.test-slash-popup/manual-home-fixed
stopped slash-live harness=claude backend=herdr endpoint=fm-lab-slash-manual-570669-31387:w1:p1 worktree=~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ
fm-control slash-live exit: agent absent; endpoint preserved
lab teardown rc=0
Evidence: Tmux submission and exit

Source: Tmux submission and exit

~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.x
tmux typed /exit state=unknown
cursor=9,7 pane=120x40 command=claude
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.x
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the requested message WILL still be sent.
●  repair missing watcher supervision according to the session-start block for this harness; do not use shell &.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
tmux fm-send /context rendered Context Usage
fm-gate-refuse: gate agent lifecycle permitted only against lab home ~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ/.x
stopped tmuxlive harness=claude backend=tmux endpoint=primary:fm-tmuxlive worktree=~/.no-mistakes/worktrees/b8ec4349de7f/01M5W4BVV35QDEMTPR1Y1SJ8PZ
tmux fm-control exit stopped Claude
private tmux server teardown rc=0
Evidence: Base versus target on this run’s live popup capture

Source: Base versus target on this run’s live popup capture

base 127f0f3 — actual live /exit popup captured in this run
state=pending
content=/exit Exit the CLI /edit-article Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revis… /context Visualize current context usage as a colored grid /usage-credits Configure usage credits or request them from your admin when you hit a limit /quiet Enter quiet supervision mode when the captain invokes /quiet or asks for quiet mode, quiet-while-present, or fewer routine wake t…
target 70911b4 — actual live /exit popup captured in this run
state=pending
content=/exit

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 warning
  • ⚠️ bin/fm-composer-lib.sh:1844 - Named Claude sessions retain the original submission failure. The supported claude -n Andrew shape has a titled top rule, which _fm_composer_scan_screen does not record as a separator. With no earlier proven envelope in the viewport, FM_COMPOSER_FOOTER_GLYPH remains -1, so this guard rejects the demotion. For a titled rule followed by ❯ /exit, a solid closing rule, and ❯ /exit Exit the CLI, extraction still returns the popup description; Herdr's payload proof clears the command without submitting it. Named-session behavior is documented at docs/verification/runtime-backends.md:959 and exercised at tests/fm-composer-lib.test.sh:192. Reuse the existing titled-rule proof when establishing the popup's composer boundary, preserving the approved box exclusion. The same invariant must hold at bin/fm-composer-lib.sh:1905 (selection), bin/fm-composer-lib.sh:2010 (extraction), and bin/fm-composer-lib.sh:2253 (classification).
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 6 of 6 scenarios driven live against the product
Scenario Result Live Evidence
Send /context through fm-send on Herdr; its Context Usage report renders and Claude remains registered. ✅ pass live manual-live-fixed.log; terminal-evidence.html
Stop Claude through fm-control exit on Herdr; the agent exits and its pane remains. ✅ pass live manual-live-fixed.log; manual-exited.txt
Type / and /no-mistakes; content reads return exactly the draft and state remains pending despite the marked popup row. ✅ pass live manual-live-fixed.log; manual-slash.ansi; manual-slashno-mistakes.ansi
Attempt another send over a pending /no-mistakes draft; submission is refused and the visible draft remains unchanged. ✅ pass live manual-live-fixed.log
Use a shell-backed tmux worker; /context renders its report and fm-control exit stops Claude. ✅ pass live tmux-live-worker.log; tmux-context-report.txt
Submit ordinary and U+2063 operational prompts on Herdr; Claude renders both requested replies. ✅ pass live ~/.no-mistakes/evidence/01M5W4BVV35QDEMTPR1Y1SJ8PZ/live-submit.log
  • TMPDIR="$PWD/.test-slash-popup/tmp" bin/fm-test-run.sh tests/fm-composer-lib.test.sh tests/fm-backend-herdr.test.sh
  • FM_HERDR_SUBMIT_CONFIRM_LIVE=1 bin/fm-test-run.sh tests/fm-herdr-submit-confirm-live-e2e.test.sh, with a marked disposable FM_HOME and session-scoped evidence wrapper.
  • Ran the retained manual-live.sh driver against isolated Herdr labs to check popup reads, overwrite refusal, fm-send, and fm-control.
  • Ran the retained tmux-live.sh driver against a private, sized tmux session using a shell-backed Claude worker.
  • Compared base and target classifier outputs against this run’s captured /exit popup: base included popup descriptions; target returned only /exit.
  • Rendered actual terminal captures as HTML, captured and inspected terminal-evidence.png, stopped the browser, tore down the labs and private tmux servers, and removed disposable worktree fixtures.
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…pup row

Claude Code 2.1.291 draws the selected row of its slash-command popup with the
same `❯` marker as its composer, so that row below the composer's closing rule
became the bottom-most bare composer candidate and the whole popup list was
read as the typed command. The Herdr Claude payload proof then judged the
payload unsent, cleared it, and reported send-failed, so `fm-control exit` and
every slash command sent through `fm-send` failed on Herdr.

Demote that row to the proven envelope above it, but only when the envelope's
own glyph row holds typed `/` text (the fallback read can never be empty) and
the row has the popup shape: a leading `/` or a truncated `…` name, then a gap
of two or more spaces before its description. Numbered-choice dialog rows,
one-word drafts, empty composers, and typed prose keep their old reading, and
the head-truncation and placeholder-remainder refusals are unchanged.

Regression tests run against real captures of the 2.1.291 screens. The live
guard gains a /context scenario, and the dated verification record is updated.
@greptile-apps

greptile-apps Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Fixes slash-command popup detection in terminal UI parsing.

The PR appears safe to merge, with a non-blocking bordered-box popup limitation still outstanding.

Reviews (2) · Last reviewed commit: "no-mistakes(ci): Both selected Greptile ..."

Comment thread bin/fm-composer-lib.sh Resolved
Comment thread docs/verification/runtime-backends.md Resolved
…live test and the verification doc changed; product code and box handling are untouched. The changes are left uncommitted for the outer executor. **ci-2** (tests/fm-herdr-submit-confirm-live-e2e.test.sh) - Invariant: a live delivery check must show that the command actually ran, through its rendered output. An empty composer and a registered agent are not enough. - Fix: after the `/context` verdict, the test now polls the pane the same way the earlier reply check does, until `/context`'s `Context Usage` heading renders. Any other result fails. - I confirmed that heading with a probe in an isolated `fm-lab-` session. The popup's description says "context usage" in lowercase, so the case-sensitive match cannot hit the popup. - The read window is 1000 lines (`--source recent --lines 1000`). The report runs to hundreds of rows here with its heading at the top, so the 200-line window the reply check uses would lose it. - The existing agent-registered and composer-empty checks are kept. The header comment, block comment and pass message were updated to match. **ci-3** (docs/verification/runtime-backends.md) - Invariant: only tests that fail against the previous classifier may be called before-and-after regressions. - I ran each of the five tests on its own against base 5838f10's `bin/fm-composer-lib.sh`: - These 3 fail there and are now labelled before-and-after regressions: `marked_row_is_not_a_second_composer`, `composer_content_..._not_the_composer`, and `send_text_submit_..._proven_and_submitted` (the last one returned 'unknown'). - These 2 pass there and are now labelled guards: `demotion_only_ever_refuses` and `popup_still_refuses_a_partial_payload`. - I corrected one more claim in the same paragraph. It said the live guard fails against the old classifier "at the `/exit` scenario". A live run against the old classifier (session `fm-lab-herdr-submit-con-1106578-15406`) actually fails earlier, at `/context`, with `send-failed`. The doc now says that. - The doc's recorded live output was replaced with the real output of the new run. **Verification** - Live guard on HEAD: `FM_HERDR_SUBMIT_CONFIRM_LIVE=1 ANTHROPIC_MODEL=claude-haiku-4-5-20251001` passed all 4 checks, including "...proves and submits a typed /context behind its command popup and renders its report". It ran in its own session, `fm-lab-herdr-submit-con-1098793-23839`. - Every live run used only its own `fm-lab-` session. Afterwards `herdr session list` shows only `default`, which was never touched. - `tests/fm-composer-lib.test.sh` returned 0 with 47 ok, and `tests/fm-backend-herdr.test.sh` returned 0 with 233 ok. - With the opt-in off, the live test skips with rc 0. - `bin/fm-lint.sh` returned 0 (ShellCheck 0.11.0, actionlint 1.7.12). - Temporary directories were removed. **Gap:** the new check's failure path was never triggered in a live run, because the old classifier fails earlier, at the verdict. That the check can tell a run from no run rests on the probe: the heading is not on screen before submission, and the popup text is lowercase
@AokDesu

AokDesu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Re-verified on Claude Code 2.1.296 (2026-10-10)

The bug still reproduces on Claude Code 2.1.296, the newest release (npm latest and next), and this PR still fixes it.

Herdr 0.8.2, real Claude Code 2.1.296 (Haiku 4.5) in an isolated lab session, typing /exit:

Check upstream main fb75c1f this PR 5b4e273
Popup's selected row still drawn with ❯ yes yes
fm_backend_herdr_composer_content the whole popup list /exit
fm_backend_herdr_send_text_submit /exit send-failed, agent still alive submitted, agent exited
bin/fm-control.sh <id> exit rc=1, "the exit command could not be sent to task ... on herdr" rc=0, agent stopped

tmux 3.7c, private server, same Claude version: /exit works on both main and this PR, and fm-control.sh exit returns rc=0 on both.
The tmux classifier also reads this popup screen as unknown.
tmux's typed submit has no pre-Enter payload proof, though, so the misread does not block the send.
The failure is Herdr-specific: it comes from the payload proof added in #5336.
This PR does not change tmux behaviour.

Related: #6813 reports the same Herdr failure on 2.1.292 and proposes a separate fix, so one of the two can land and the other can be closed.

@AokDesu

AokDesu commented Oct 10, 2026

Copy link
Copy Markdown
Contributor Author

Following the triage on #6759 that points at this PR: the CI and Require no-mistakes workflows have not run here yet. Both are waiting for maintainer approval, since this is a first contribution from a fork.
Could a maintainer approve the workflow runs so CI can report on head 5b4e273?
If you'd prefer it rebased onto current main first (it is behind but merges cleanly), say so and I'll update it.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @AokDesu, and thanks for the 2.1.296 re-verification. Sorry the runs sat waiting.

I reviewed the diff (bin/fm-composer-lib.sh classifier, captures, tests, docs): no workflow, secret, or network surface. So I approved the fork CI and no-mistakes runs for head 5b4e2730, which the attestation binds. No rebase is needed while it merges cleanly.

My verdict:

  • Contract-class: restore. fm-control <id> exit on Herdr with Claude ≥ 2.1.291 is an existing default path that broke when the popup's marked row was read as the composer. The fix narrows only that misread, and tmux is unchanged.
  • VISION: all seven rules align. Delivery stays proof-gated, a refusal path is kept ("demotion only ever refuses"), and the live evidence is 7/8 plus your 2.1.296 re-check.

One note: #6813 fixes the same Herdr popup failure. Only one of the two will land, and the other will be closed with thanks.

Status: waiting on CI — nothing is needed from you right now. If CI and no-mistakes come back green and it stays clean, this is eligible to merge.

@AokDesu

AokDesu commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for approving the runs on Oct 11. Neither has started since: CI (run 37456862107) and Require no-mistakes (run 37456862525) for head 5b4e2730 still show queued, with run_started_at 2026-10-11T02:20Z and no jobs created.

It does not look specific to this PR. Right now the repository has 23 queued runs, from 7 forks (AgardnerAU, AokDesu, HotThoughts, iamjaredwalters, leonardourci, maruthiprithivi, nchandar). All 23 were approved days after they were created, and none has a job (/actions/runs/<id>/jobs returns total_count: 0 for each). Runs on newer PRs reach action_required as usual.

If re-running these two workflows from the Actions tab does not start them, I can rebase this branch onto current main so a fresh pair of runs is created. It is 30 commits behind but still merges cleanly. That would move the head away from the 5b4e2730 you reviewed, so I'll only do it if you prefer that.

tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Oct 13, 2026
…d above Claude's glyph-marked popup row (#81)

* fix(bin): read a typed slash command above Claude 2.1.291's marked popup row

Claude Code 2.1.291 draws the selected row of its slash-command popup with the
same `❯` marker as its composer, so that row below the composer's closing rule
became the bottom-most bare composer candidate and the whole popup list was
read as the typed command. The Herdr Claude payload proof then judged the
payload unsent, cleared it, and reported send-failed, so `fm-control exit` and
every slash command sent through `fm-send` failed on Herdr.

Demote that row to the proven envelope above it, but only when the envelope's
own glyph row holds typed `/` text (the fallback read can never be empty) and
the row has the popup shape: a leading `/` or a truncated `…` name, then a gap
of two or more spaces before its description. Numbered-choice dialog rows,
one-word drafts, empty composers, and typed prose keep their old reading, and
the head-truncation and placeholder-remainder refusals are unchanged.

Regression tests run against real captures of the 2.1.291 screens. The live
guard gains a /context scenario, and the dated verification record is updated.

* no-mistakes(review): Ghost-strip popup demotion guard; relocate 2.1.291 docs

* no-mistakes(review): Match popup guard to fallback's plain glyph row

* no-mistakes(review): Narrow box popup test; note box follow-up in docs

* no-mistakes(document): Point same-glyph footer rule at 2.1.291 popup exception

* no-mistakes(ci): Both selected Greptile findings are fixed. Only the live test and the verification doc changed; product code and box handling are untouched. The changes are left uncommitted for the outer executor. **ci-2** (tests/fm-herdr-submit-confirm-live-e2e.test.sh) - Invariant: a live delivery check must show that the command actually ran, through its rendered output. An empty composer and a registered agent are not enough. - Fix: after the `/context` verdict, the test now polls the pane the same way the earlier reply check does, until `/context`'s `Context Usage` heading renders. Any other result fails. - I confirmed that heading with a probe in an isolated `fm-lab-` session. The popup's description says "context usage" in lowercase, so the case-sensitive match cannot hit the popup. - The read window is 1000 lines (`--source recent --lines 1000`). The report runs to hundreds of rows here with its heading at the top, so the 200-line window the reply check uses would lose it. - The existing agent-registered and composer-empty checks are kept. The header comment, block comment and pass message were updated to match. **ci-3** (docs/verification/runtime-backends.md) - Invariant: only tests that fail against the previous classifier may be called before-and-after regressions. - I ran each of the five tests on its own against base 5838f10's `bin/fm-composer-lib.sh`: - These 3 fail there and are now labelled before-and-after regressions: `marked_row_is_not_a_second_composer`, `composer_content_..._not_the_composer`, and `send_text_submit_..._proven_and_submitted` (the last one returned 'unknown'). - These 2 pass there and are now labelled guards: `demotion_only_ever_refuses` and `popup_still_refuses_a_partial_payload`. - I corrected one more claim in the same paragraph. It said the live guard fails against the old classifier "at the `/exit` scenario". A live run against the old classifier (session `fm-lab-herdr-submit-con-1106578-15406`) actually fails earlier, at `/context`, with `send-failed`. The doc now says that. - The doc's recorded live output was replaced with the real output of the new run. **Verification** - Live guard on HEAD: `FM_HERDR_SUBMIT_CONFIRM_LIVE=1 ANTHROPIC_MODEL=claude-haiku-4-5-20251001` passed all 4 checks, including "...proves and submits a typed /context behind its command popup and renders its report". It ran in its own session, `fm-lab-herdr-submit-con-1098793-23839`. - Every live run used only its own `fm-lab-` session. Afterwards `herdr session list` shows only `default`, which was never touched. - `tests/fm-composer-lib.test.sh` returned 0 with 47 ok, and `tests/fm-backend-herdr.test.sh` returned 0 with 233 ok. - With the opt-in off, the live test skips with rc 0. - `bin/fm-lint.sh` returned 0 (ShellCheck 0.11.0, actionlint 1.7.12). - Temporary directories were removed. **Gap:** the new check's failure path was never triggered in a live run, because the old classifier fails earlier, at the verdict. That the check can tell a run from no run rests on the probe: the heading is not on screen before submission, and the popup text is lowercase

---------

Co-authored-by: Aok <[email protected]>
tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Oct 17, 2026
…d above Claude's glyph-marked popup row (#81)

* fix(bin): read a typed slash command above Claude 2.1.291's marked popup row

Claude Code 2.1.291 draws the selected row of its slash-command popup with the
same `❯` marker as its composer, so that row below the composer's closing rule
became the bottom-most bare composer candidate and the whole popup list was
read as the typed command. The Herdr Claude payload proof then judged the
payload unsent, cleared it, and reported send-failed, so `fm-control exit` and
every slash command sent through `fm-send` failed on Herdr.

Demote that row to the proven envelope above it, but only when the envelope's
own glyph row holds typed `/` text (the fallback read can never be empty) and
the row has the popup shape: a leading `/` or a truncated `…` name, then a gap
of two or more spaces before its description. Numbered-choice dialog rows,
one-word drafts, empty composers, and typed prose keep their old reading, and
the head-truncation and placeholder-remainder refusals are unchanged.

Regression tests run against real captures of the 2.1.291 screens. The live
guard gains a /context scenario, and the dated verification record is updated.

* no-mistakes(review): Ghost-strip popup demotion guard; relocate 2.1.291 docs

* no-mistakes(review): Match popup guard to fallback's plain glyph row

* no-mistakes(review): Narrow box popup test; note box follow-up in docs

* no-mistakes(document): Point same-glyph footer rule at 2.1.291 popup exception

* no-mistakes(ci): Both selected Greptile findings are fixed. Only the live test and the verification doc changed; product code and box handling are untouched. The changes are left uncommitted for the outer executor. **ci-2** (tests/fm-herdr-submit-confirm-live-e2e.test.sh) - Invariant: a live delivery check must show that the command actually ran, through its rendered output. An empty composer and a registered agent are not enough. - Fix: after the `/context` verdict, the test now polls the pane the same way the earlier reply check does, until `/context`'s `Context Usage` heading renders. Any other result fails. - I confirmed that heading with a probe in an isolated `fm-lab-` session. The popup's description says "context usage" in lowercase, so the case-sensitive match cannot hit the popup. - The read window is 1000 lines (`--source recent --lines 1000`). The report runs to hundreds of rows here with its heading at the top, so the 200-line window the reply check uses would lose it. - The existing agent-registered and composer-empty checks are kept. The header comment, block comment and pass message were updated to match. **ci-3** (docs/verification/runtime-backends.md) - Invariant: only tests that fail against the previous classifier may be called before-and-after regressions. - I ran each of the five tests on its own against base 5838f10's `bin/fm-composer-lib.sh`: - These 3 fail there and are now labelled before-and-after regressions: `marked_row_is_not_a_second_composer`, `composer_content_..._not_the_composer`, and `send_text_submit_..._proven_and_submitted` (the last one returned 'unknown'). - These 2 pass there and are now labelled guards: `demotion_only_ever_refuses` and `popup_still_refuses_a_partial_payload`. - I corrected one more claim in the same paragraph. It said the live guard fails against the old classifier "at the `/exit` scenario". A live run against the old classifier (session `fm-lab-herdr-submit-con-1106578-15406`) actually fails earlier, at `/context`, with `send-failed`. The doc now says that. - The doc's recorded live output was replaced with the real output of the new run. **Verification** - Live guard on HEAD: `FM_HERDR_SUBMIT_CONFIRM_LIVE=1 ANTHROPIC_MODEL=claude-haiku-4-5-20251001` passed all 4 checks, including "...proves and submits a typed /context behind its command popup and renders its report". It ran in its own session, `fm-lab-herdr-submit-con-1098793-23839`. - Every live run used only its own `fm-lab-` session. Afterwards `herdr session list` shows only `default`, which was never touched. - `tests/fm-composer-lib.test.sh` returned 0 with 47 ok, and `tests/fm-backend-herdr.test.sh` returned 0 with 233 ok. - With the opt-in off, the live test skips with rc 0. - `bin/fm-lint.sh` returned 0 (ShellCheck 0.11.0, actionlint 1.7.12). - Temporary directories were removed. **Gap:** the new check's failure path was never triggered in a live run, because the old classifier fails earlier, at the verdict. That the check can tell a run from no run rests on the probe: the heading is not on screen before submission, and the popup text is lowercase

---------

Co-authored-by: Aok <[email protected]>
tiago-peixoto added a commit to tiago-peixoto/firstmate that referenced this pull request Oct 17, 2026
…d above Claude's glyph-marked popup row (#81)

* fix(bin): read a typed slash command above Claude 2.1.291's marked popup row

Claude Code 2.1.291 draws the selected row of its slash-command popup with the
same `❯` marker as its composer, so that row below the composer's closing rule
became the bottom-most bare composer candidate and the whole popup list was
read as the typed command. The Herdr Claude payload proof then judged the
payload unsent, cleared it, and reported send-failed, so `fm-control exit` and
every slash command sent through `fm-send` failed on Herdr.

Demote that row to the proven envelope above it, but only when the envelope's
own glyph row holds typed `/` text (the fallback read can never be empty) and
the row has the popup shape: a leading `/` or a truncated `…` name, then a gap
of two or more spaces before its description. Numbered-choice dialog rows,
one-word drafts, empty composers, and typed prose keep their old reading, and
the head-truncation and placeholder-remainder refusals are unchanged.

Regression tests run against real captures of the 2.1.291 screens. The live
guard gains a /context scenario, and the dated verification record is updated.

* no-mistakes(review): Ghost-strip popup demotion guard; relocate 2.1.291 docs

* no-mistakes(review): Match popup guard to fallback's plain glyph row

* no-mistakes(review): Narrow box popup test; note box follow-up in docs

* no-mistakes(document): Point same-glyph footer rule at 2.1.291 popup exception

* no-mistakes(ci): Both selected Greptile findings are fixed. Only the live test and the verification doc changed; product code and box handling are untouched. The changes are left uncommitted for the outer executor. **ci-2** (tests/fm-herdr-submit-confirm-live-e2e.test.sh) - Invariant: a live delivery check must show that the command actually ran, through its rendered output. An empty composer and a registered agent are not enough. - Fix: after the `/context` verdict, the test now polls the pane the same way the earlier reply check does, until `/context`'s `Context Usage` heading renders. Any other result fails. - I confirmed that heading with a probe in an isolated `fm-lab-` session. The popup's description says "context usage" in lowercase, so the case-sensitive match cannot hit the popup. - The read window is 1000 lines (`--source recent --lines 1000`). The report runs to hundreds of rows here with its heading at the top, so the 200-line window the reply check uses would lose it. - The existing agent-registered and composer-empty checks are kept. The header comment, block comment and pass message were updated to match. **ci-3** (docs/verification/runtime-backends.md) - Invariant: only tests that fail against the previous classifier may be called before-and-after regressions. - I ran each of the five tests on its own against base 5838f10's `bin/fm-composer-lib.sh`: - These 3 fail there and are now labelled before-and-after regressions: `marked_row_is_not_a_second_composer`, `composer_content_..._not_the_composer`, and `send_text_submit_..._proven_and_submitted` (the last one returned 'unknown'). - These 2 pass there and are now labelled guards: `demotion_only_ever_refuses` and `popup_still_refuses_a_partial_payload`. - I corrected one more claim in the same paragraph. It said the live guard fails against the old classifier "at the `/exit` scenario". A live run against the old classifier (session `fm-lab-herdr-submit-con-1106578-15406`) actually fails earlier, at `/context`, with `send-failed`. The doc now says that. - The doc's recorded live output was replaced with the real output of the new run. **Verification** - Live guard on HEAD: `FM_HERDR_SUBMIT_CONFIRM_LIVE=1 ANTHROPIC_MODEL=claude-haiku-4-5-20251001` passed all 4 checks, including "...proves and submits a typed /context behind its command popup and renders its report". It ran in its own session, `fm-lab-herdr-submit-con-1098793-23839`. - Every live run used only its own `fm-lab-` session. Afterwards `herdr session list` shows only `default`, which was never touched. - `tests/fm-composer-lib.test.sh` returned 0 with 47 ok, and `tests/fm-backend-herdr.test.sh` returned 0 with 233 ok. - With the opt-in off, the live test skips with rc 0. - `bin/fm-lint.sh` returned 0 (ShellCheck 0.11.0, actionlint 1.7.12). - Temporary directories were removed. **Gap:** the new check's failure path was never triggered in a live run, because the old classifier fails earlier, at the verdict. That the check can tell a run from no run rests on the probe: the heading is not on screen before submission, and the popup text is lowercase

---------

Co-authored-by: Aok <[email protected]>
@fortknox204

Copy link
Copy Markdown

Independent confirmation from a user/operator home: this fixes the idle-worker fm-control exit / relaunch failure reported in #6136 and #6759, on Claude Code 2.1.304 with herdr 0.9.0.

What I saw before the change: bin/fm-control.sh <id> exit failed on idle Claude workers with the exit command could not be sent to task <id> on herdr. Typing /exit opens Claude's slash popup, its selected row is drawn as ❯ /exit Exit the CLI, and the composer classifier took that row as the live composer, so the read-back was the whole popup list and the payload proof failed.

Checked against two real 2.1.304 captures with fm_composer_extract_selected_content:

Capture main #7388 #6695
popup, no notice row whole menu /exit /exit
popup with a notice row above it (inherited CLAUDE_CODE_CHILD_SESSION transcript warning) whole menu whole menu /exit

So #6695 also covers the shape where a notice row sits between the rule and the popup, which #7388 does not.

With this PR applied unchanged on main 3eabd356:

  • tests/fm-composer-lib.test.sh and tests/fm-backend-herdr.test.sh pass; bin/fm-lint.sh clean.
  • FM_HERDR_SUBMIT_CONFIRM_LIVE=1 tests/fm-herdr-submit-confirm-live-e2e.test.sh: fails on main (a typed /exit behind its command popup was judged unsent and cleared), passes 4/4 with the PR.
  • Live in an isolated Herdr lab with a real idle Claude 2.1.304 worker and the real bin/fm-control.sh: main reproduces the error; with the PR, exit stops it, relaunch brings up a replacement in the same pane, and a second exit stops that one.

Would love to see this merged so we can stay on stock firstmate.

@emplares

Copy link
Copy Markdown

Independent check on Claude Code 2.1.309 (newer than the 2.1.304 already confirmed here), on a remote Herdr host that uses Claude's default inline renderer.

What the failure looked like. fm-control exit / fm-secondmate-restart on the remote second mate died with the exit command could not be sent to task <id> on herdr. The typed /exit is cleared and Enter is never sent, so the agent keeps running.

Why it only shows on some setups. With the inline renderer (the default), the slash menu is drawn below the composer, and its selected row starts with the same ❯ glyph. With "tui": "fullscreen" Claude draws the menu above the composer, where the existing reader already picks the right row. In a lab with the same 2.1.309 binary, the inline renderer reproduced the failure and fullscreen did not. A home on fullscreen will therefore never see this bug.

Check against the open PR heads. I ran fm_composer_extract_selected_content 'styled=0' on a screen reproduced from the 2.1.309 lab capture (composer between two rules, ❯ /exit Exit the CLI marker row under the closing rule, a wrapped description row with no marker), once with /exit typed and once with /exi:

rule
❯ /exit                          (composer; second run: ❯ /exi)
rule
  ❯ /exit                      Exit the CLI
    /context                   Visualize current context usage as a colored grid
    /some-long-command         A description long enough that it wraps onto
                               a second, unmarked row
ref /exit /exi
main abb81944 /exit Exit the CLI /context Visualize ... a second, unmarked same, whole menu
#6695 5b4e2730 /exit /exi
#7388 e9a5159 /exit /exi
#6813 fdb159e /exit /exi

So on 2.1.309's inline layout all three heads read the composer correctly; only main fails. This is the shared reader on a reproduced screen, not a live fm-control exit run against each PR head. The regression screen in the lab capture also kept the NBSP after the glyph and CRLF row ends, which this plain-text check does not exercise.

Suggestion for whichever PR lands: the existing popup fixture draws the first menu row without the ❯ marker (the 2.1.283 shape); a fixture with the marker, like the screen above, would keep this from regressing silently.

@kunchenguid

Copy link