Repository navigation
fix(bin): name why a doorbell did not reach a narrow named Claude pane - #378
Merged
Merged
Conversation
Port of upstream 6935592 (kunchenguid/firstmate kunchenguid#8501). A titled top rule was accepted only when the glyph row sat directly on the closing rule, so a doorbell that wrapped in a narrow named Claude pane read unknown and herdr's submit proof withheld Enter.
tests/fm-composer-lib.test.sh and tests/fm-backend-herdr.test.sh read tests/captures/claude-2.1.291-slash-popup, which never landed on this fork's main, so the composer suite stopped before the wrapped-composer case. Copied byte-for-byte from upstream main (blobs match 6750c10).
fm_task_inbox_ring's return 2 collapsed several failures into one notice and discarded the reason: the ring budget running out, a refused submit whose stderr went to /dev/null, and the backend's own send-failed verdict. The ring now hands its caller FM_TASK_INBOX_RING_REASON (budget exceeded, submit failed: <stderr>, send failed[: <stderr>], Enter failed[: <stderr>], or an unprintable inbox name), and fm-send's "did not reach" notice names it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
ZFlow order: M4 Main order 1796002929 item 1 (2026-11-29)
Authority: M4 Main (now term_f082c5be-1426-4e66-a1f9-579992bcc76e) approved shipping three Firstmate fork fixes in this order. Same terms as #369 and #371:
Run them ONE AT A TIME: start the next only when the previous PR is green (or parked on a decision you escalate to ZFlow).
Item 1. fm-doorbell-pane-addr (priority 0)
Substance of the referenced report (data/fm-doorbell-pane-addr/report.md), which is not in the repository:
<herdr-session>:<pane-id>(for example default:w1K:p3) is Firstmate's own format; every herdr call splits it at the first colon (fm_backend_herdr_parse_target) and passes the session as --session and the pane id separately, so the format and addressing need no change.unknown, herdr's Claude submit proof could not see the typed doorbell, cleared it, and withheld Enter. Upstream commit 6935592 (kunchenguid/firstmate fix: support wrapped Claude composer readback kunchenguid/firstmate#8501) accepts contiguous, non-blank, edge-free wrap rows between the glyph row and the closing rule, bounded by FM_COMPOSER_PI_MAX_LINES; a blank row or an overlong region still reads unknown.What Changed
_fm_composer_bare_rule_sandwichinbin/fm-composer-lib.shnow accepts wrap rows between the glyph row and the closing rule of a Claude composer whose top rule shows a session name. The rows must be contiguous, non-blank, edge-free, and withinFM_COMPOSER_PI_MAX_LINES, as in upstream 6935592. Before this, a doorbell line that wrapped in a narrow pane readunknown, and Enter was withheld. A blank or overlong region still readsunknown.fm_task_inbox_ringnow passes the reason for a return 2 back inFM_TASK_INBOX_RING_REASON, carried out of the child process through a temporary file. The reason is one of: ring budget exceeded,submit failed: <stderr>,send failed[: <stderr>],Enter failed[: <stderr>], or an unprintable inbox name. Backend stderr is now kept rather than sent to/dev/null.fm-sendadds the reason to its "doorbell did not reach" message.tests/captures/claude-2.1.291-slash-popup/fixtures so the composer suite runs to the end. Adds tests for the wrapped typed line and for each ring failure reason in the composer, task-inbox, and send-inbox tests, and updatesdocs/verification/runtime-backends.mdto match.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change is small and bounded. It widens the titled-composer sandwich to allow a contiguous, non-blank, edge-free wrap region capped by FM_COMPOSER_PI_MAX_LINES, so blank and overlong regions still read unknown. Every return-2 path of the ring now writes a one-line reason through a temp file that the parent cleans up, even on timeout. fm-send only adds that reason to its existing message, and the other callers are unaffected.
Testing
I ran the three colocated suites for the changed scripts (composer, task inbox, fm-send inbox) and all passed. The composer suite now reaches its end with the restored fixtures. Its new wrapped-composer test fails against the base library and passes on this branch, so it reproduces the regression. I then drove the real product: a real Claude Code session run with a session name in a 44-column pane on a disposable lab tmux server. On the real wrapped screen, the base library reads
unknownand the new one readspendingwith the exact typed text; the idle composer readsempty. Real fm-send into that pane delivered the doorbell normally. With a 1s budget it printed "did not reach … (ring budget of 1s exceeded)" and still recorded the steer and exited 0. A herdr-addressed send (default:wB:pG) went through a stub herdr CLI, since herdr is not installed. It named the budget as its reason, and the composite address resolved without error. The titled-glyph guard cases and the submit-failed, send-failed and Enter-failed reasons are covered only by unit tests, not live. I could not inspect the recorded pane from tonight because no herdr server or CLI exists on this host. I tore down the lab home, the tmux server, the Claude process and the temporary copies; the worktree is clean. Overall: go.Evidence: Real Claude wrapped composer: cursorless classification, new vs base library
Source: Real Claude wrapped composer: cursorless classification, new vs base library
NEW lib: cursorless-state=pending content=list the inbox, read each msg in numeric order, then mv it into handled/ BASE lib (75aa7dd8): cursorless-state=unknown content=Evidence: Real Claude 44-col named-session pane, wrapped typed text (plain capture)
Source: Real Claude 44-col named-session pane, wrapped typed text (plain capture)
Evidence: Real Claude pane, styled capture used for classification
Source: Real Claude pane, styled capture used for classification
Evidence: Real Claude idle titled composer reads empty
Source: Real Claude idle titled composer reads empty
Evidence: fm-send names the budget reason (real Claude pane)
Source: fm-send names the budget reason (real Claude pane)
fm-send: doorbell did not reach primary:fm-t1 (ring budget of 1s exceeded); the steer is durably recorded at .../state/t1.inbox/002.msg and the watcher will re-ring exit=0Evidence: fm-send default budget delivers to the narrow named Claude pane
Source: fm-send default budget delivers to the narrow named Claude pane
Evidence: fm-send to a herdr composite address with an unreachable herdr (stub CLI)
Source: fm-send to a herdr composite address with an unreachable herdr (stub CLI)
Evidence: Composer test against the base library (regression reproduced)
Source: Composer test against the base library (regression reproduced)
Evidence: Composer suite log (branch)
Source: Composer suite log (branch)
Evidence: Task inbox suite log
Source: Task inbox suite log
Evidence: fm-send inbox suite log
Source: fm-send inbox suite log
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(rc=0, runs to the end with the restored claude-2.1.291-slash-popup fixtures)bash tests/fm-task-inbox.test.sh(rc=0, includes test_ring_names_a_refused_submit and the reason check for an unprintable inbox name)bash tests/fm-send-inbox.test.sh(rc=0, includes test_failed_ring_names_its_reason)Regression check: new tests/fm-composer-lib.test.sh plus the restored fixtures run against the base commit 75aa7dd8 tree ->not ok - named claude wrapped typed on herdr: expected pending, got 'unknown'Live: realclaude -n Andrewin a 44x30 pane on the lab's private tmux server (bin/fm-lab-home.sh tmux); typed a 72-char line with no Enter; captured it withcapture-pane -e; classified it cursorless (herdr caps) with the new and base librariesLive: cleared the composer and classified the idle titled composer (empty)Live: realbin/fm-send.sh t1with FM_SEND_RING_BUDGET=1 into the real Claude pane -> 'did not reach primary:fm-t1 (ring budget of 1s exceeded)', exit 0, steer recordedLive: realbin/fm-send.sh t1with the default budget into the same narrow named Claude pane -> doorbell typed and submitted, no 'did not reach' line, Claude processed the inboxSemi-live: realbin/fm-send.sh t2with meta window=default:wB:pG backend=herdr, with a stub herdr CLI that always errors (no herdr installed) -> 'did not reach default:wB:pG (ring budget of 20s exceeded)'✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.