Repository navigation
fix(bin): send Claude's typed /exit when its slash popup draws below the composer - #7388
MoemenDarwish wants to merge 2 commits into
Conversation
…ow the composer Claude Code 2.1.301 can draw the slash-command popup directly below the composer's closing rule, with its selected row led by the same `❯` the composer uses. The shared composer classifier took that popup row as the bottom-most live composer, so the herdr payload proof read the whole menu instead of `/exit`, cleared the composer, and reported send-failed. fm-control exit then failed with "the exit command could not be sent", and relaunch and fm-secondmate-restart inherited it. The composer footer zone now counts popup rows as envelope furniture only while the envelope's own glyph row holds a typed `/` command, only as the run's leading indented rows, and with wrapped descriptions only at their column, so the pending-text, dialog, and revert-picker refusals are unchanged and the exception can never produce `empty`. The herdr submit confirmation budget and poll interval now compute awk under LC_ALL=C, since a comma-decimal locale made macOS awk collapse the interval. The piped composer-probe test uses fm_run_timed instead of GNU timeout.
…herdr backend doc
|
Speaking as Kun's firstmate: thanks @MoemenDarwish — great diagnosis, and the live lab capture of the 2.1.301 popup-below-composer shape makes this easy to trust. VISION per-rule
Contract-class: restore — CI: reviewed the diff for first-time-fork safety (no |
|
Could a maintainer please rerun the cancelled 'Behavior portable serial 2' job? GitHub cancelled it at the 30-minute job limit with no verdict - no test in it failed, and the other 18 checks passed. The same shard also hit the 30-minute limit on main (CI run 38843155914), where tests/fm-supervision-host.test.sh alone takes about 29 minutes. |
|
Speaking as Kun's firstmate: thanks @MoemenDarwish — done. I re-ran only the cancelled Behavior portable serial 2 job on CI run Re-checked live against main Nothing is needed from you. Once serial 2 comes back green, this goes on the auto-merge path. |
Intent
fix the tool first
Context: the captain asked to move both persistent second mates (raneen-hyva-mate, raneen-kiosk-mate) and the long-running raneen-traffic-sentinel worker onto a different Claude account by restarting them. On 2026-10-15 (~19:10Z) every restart failed the same way, on herdr 0.9.3 with Claude Code sessions:
The die is at bin/fm-control.sh ~731-733, after fm_backend_send_text_submit "$BACKEND" "$T" "$cmd" (cmd = Claude's exit command) either returned non-zero or the verdict send-failed. The composer was idle and empty at the time (agent_status done, empty ❯ prompt). herdr pane get now returns a valid pane_id for these panes. The same symptom was first seen 2026-10-10 after updating to fb75c1f (then also with an empty pane_id from herdr pane get). Possibly related but different: upstream issue Herdr + Claude: doorbell always fails (rc 2) in narrow or short panes because the composer proof sees a clipped composer #7354 (Claude composer proof fails on clipped composers in narrow/short panes, doorbell rc 2) - check whether the composer-proof logic in fm_backend_herdr_send_text_submit is also what rejects the short exit command here.
What Changed
bin/fm-composer-lib.sh: the composer footer-zone classifier now treats Claude Code's slash-command popup, drawn directly below the composer's closing rule with a❯-led selected row, as footer furniture. This applies only while the composer's own glyph row holds a typed/command. Popup rows must be the leading rows of the run, indented off column 0, and a wrapped description must sit at the recorded description column. This lets the payload proof read the typed/exitinstead of the whole menu, which is whyfm-controlrelaunch andfm-secondmate-restartcould not send the exit command on herdr. The exception can never produceempty.bin/backends/herdr.sh: both submit-confirmation awk budget computations (fm_backend_herdr_submit_confirm_budgetand the poll interval infm_backend_herdr_wait_for_working) now run underLC_ALL=C, so comma-decimal locales no longer collapse the poll interval and confirmation window.docs/herdr-backend.mdanddocs/verification/runtime-backends.mdwith the dated measurement ("Claude slash-command popup below the composer"). The live e2e submit-confirm test was also adjusted.Risk Assessment
✅ Low: The change narrowly teaches the composer footer-zone classifier to treat Claude 2.1.301's below-composer slash popup as furniture only under a typed
/envelope. That exception can only produce a pending/refusal verdict, neverempty. The awk locale fix is a small, correct addition, and the new portable tests exercise real behavior.Testing
I ran the two portable suites that cover the change and the repo's live Herdr submit-confirm guard, all passing. I also confirmed the new composer-lib regression fails on the base commit. In a throwaway fm-lab session I reproduced the popup-below-composer screen with real Claude. The base classifier read the whole menu as the composer content, HEAD read "/exit", and send_text_submit at HEAD submitted /exit so Claude exited. The adversarial popup-shape scenario and the comma-decimal locale scenario were covered only by synthetic unit tests, not driven live, so they are recorded as untested live. I did not drive bin/fm-control.sh exit, relaunch, or bin/fm-secondmate-restart.sh end to end, and I did not run the second-CLAUDE_CONFIG_DIR variant the docs mention, so those stay unexercised. The lab was torn down.
Evidence: Live Claude 2.1.301 capture with the popup below the composer (plain)
Source: Live Claude 2.1.301 capture with the popup below the composer (plain)
Evidence: Same capture with ANSI styling
Source: Same capture with ANSI styling
Evidence: Composer state/content on the live capture, HEAD vs base
Source: Composer state/content on the live capture, HEAD vs base
Evidence: send_text_submit /exit result and agent exit
Source: send_text_submit /exit result and agent exit
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bash tests/fm-composer-lib.test.sh(all ok, incl. the new slash-popup footer-zone test)bash tests/fm-backend-herdr.test.sh(all ok, incl. the new popup-below-composer submit test and the comma-decimal locale test)Base-commit check: the new composer-lib test run against 1a6714f2 bin/ fails with the whole popup menu extracted as composer contentenv -u CLAUDE_CONFIG_DIR -u TMUX -u HERDR_PANE_ID FM_HERDR_SUBMIT_CONFIRM_LIVE=1 bash tests/fm-herdr-submit-confirm-live-e2e.test.sh(all three live scenarios ok, including the typed /exit with the popup)Live fm-lab probe: real Claude 2.1.301 on herdr 0.9.5,/exittyped so the popup draws below the composer; I ran fm_backend_herdr_composer_state and fm_backend_herdr_composer_content from HEAD and from the base commitLive fm-lab probe: fm_backend_herdr_send_text_submit with /exit on the popup-below screen at HEAD; the agent then disappeared and the pane showed a shell prompt✅ **Document** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.