Repository navigation
Description
Summary
A large single typed delivery into a Claude Code pane on Herdr (away-mode digests from bin/fm-supervise-daemon.sh, and ordinary fm-send steers) can be submitted with its head missing: Claude's composer receives the full text, classifies the fast ASCII burst as paste input in PTY-sized partitions, and when a paste-classified partition is followed by a small literal remainder the earlier partitions disappear. Only the suffix remains in the composer; the backend then presses Enter, Claude records the suffix as the complete user turn, and fm_backend_send_text_submit reports empty (success). The receiver therefore gets a different instruction than the one sent, with no error anywhere.
Observed live on 2026-09-01: 3 of 8 away-mode digests arrived head-truncated (one kept only the trailing (pre-read; re-arm not needed ...) marker, so the escalation it carried was silently lost for ~12 minutes). An earlier incident on 2026-08-26 delivered a 1,037-byte steer ending Never auto-pass it. to a worker as auto-pass it.
Environment
- firstmate
355f46fe5528ccc9790481171bf9da48dee2e90d(currentorigin/mainat investigation time) - Herdr 0.8.2 (protocol 20), Claude Code 2.1.257, macOS (Darwin 25.5.0, arm64)
- Delivery path:
bin/fm-supervise-daemon.shinject_msg->bin/fm-backend.shtyped delivery ->bin/backends/herdr.shonepane send-textcall, then Enter, then a post-submit composer/turn check
Reproduction (isolated named Herdr session, scratch Claude instance, no model call needed)
Herdr transport is intact. Sending 300 / 800 / 1,500 / 3,000 ASCII characters into a plain shell cat (noncanonical mode) arrived byte-exact every time.
Claude Code composer, full backend submit path, real U+2063 operational sentinel; every row returned the backend verdict empty:
| Requested chars | Run A | Run B |
|---|---|---|
| 799-1,020 | exact | exact |
| 1,021 | last 1 char only | last 1 char only |
| 1,022 | last 2 chars only | exact |
| 1,100 | last 80 | last 80 |
| 1,500 | last 480 | last 480 |
| 1,800 | last 780 | last 780 |
| 1,820 | not run | last 800 |
| 1,821-2,041 | exact | exact |
| 2,500 | exact | last 458 |
| 2,800 | exact | last 758 |
| 3,000 | exact | exact |
- Capturing the composer before Enter already showed only the suffix (e.g. the 1,500-char message was exactly its last 480 chars); Claude's session JSONL then persisted that suffix as the user message. Enter does not cause the loss; it makes the malformed composer authoritative.
- A single pure-ASCII burst stays literal through 800 chars and becomes
[Pasted text #N]at 801. A lone paste placeholder expands correctly on submit (3,000 chars arrived whole as three placeholders); loss appears when a paste partition is followed by a small literal remainder, and partitioning varies between runs, so no total-length cutoff above the safe cap is stable. - Controls: 1,500 chars sent as 256-char writes 150 ms apart arrived exact; 801 mostly-accented chars (1,527 bytes) and 500 CJK chars (~931 columns) stayed literal - so this is not a byte, Unicode-character, or column limit.
Why nothing caught it
bin/backends/herdr.sh submit path sends the full text once, waits, presses Enter, and then only asks whether a turn began or the composer is empty. It never proves that the current composer contains the intended payload before Enter, so a suffix satisfies the contract. Nearest existing work: #1859, #1506, #2483, #2917, #3436, #3366 (delivery prevented or repeated, not payload integrity); PR #2956, #2814, #2260 (closed, unmerged); PR #2800 (open, tmux-only exact composer-append proof - the right shape, but not covering Herdr/Claude bulk paste ingestion); commits from #323 and #2647 improve confirmation after Enter, which is exactly why a submitted suffix is misclassified as success.
Proposed fix (medium)
- Refuse any typed payload above a conservative cap (700 UTF-8 bytes) before touching a pane.
- In away mode, replace over-cap prose with bounded per-event previews plus task/status-file pointers; keep the full durable source in the status log.
- After the literal send and before Enter, extract the selected current composer and prove the intended payload was appended there - never search the whole pane (a stale earlier operational message in scrollback can supply a matching head while the composer holds only a tail).
- If the proof fails or only a tail is present: do not press Enter, preserve the escalation buffer, report the truncation verdict.
- Regression matrix: 1,500 single-write tail-only; 3,000 nonmonotonic control; 1,500 chunked exact control; stale matching head in transcript; current-composer-only proof.
Chunked delivery alone is not a safe primary fix (multi-write transaction races with focus/human input/Enter timing, and still lacks proof without composer readback). A marker at both ends would only make damage recognizable; it would still submit a different instruction.
Interim workaround in use: cap every typed message to a Claude pane at 700 bytes and send longer instructions as a file path.
Activity
kunchenguid commentedon Sep 1, 2026
Speaking as Kun's firstmate: this is waiting on a contributor PR (not waiting on the captain). Labeled
ready-for-pr. Do not implement from this triage pass.What I inspected
3264studios(not kunchenguid, not a bot).fix(tmux): refuse text dropped by composer, HEAD20aec68): tmux-only composer-append proof. Right shape, but it does not touchbin/backends/herdr.shor Claude paste-partition ingestion, so this is notexisting-pr.41d0ab3910ece4e90db0194f756437b3abe8ab8f(post-fix: surface inbound Relay media to responding agents #3442 Relay media playbook; not a delivery-path change). Investigation SHA355f46feis older; the submit core is unchanged on this point.Current main delivery path
fm_backend_herdr_send_text_submit(bin/backends/herdr.sh~2790) still: onepane send-text, settle, Enter, then confirm via nativeworking/ composerempty/ queued-Enter. It never extracts the selected current composer or proves the intended payload was appended before Enter. A suffix that then submits still yieldsempty(success).inject_msginbin/fm-supervise-daemon.shtreats thatemptyas delivered and clears the buffer.Zellij on the same main already proves append-before-Enter (
fm_backend_zellij_composer_observed_append) and refuses without Enter on failure. That is the fleet contract Herdr typed delivery is missing. Latest main does not already fix this.Contract class: restore
Unconfigured typed delivery is already promised to submit the intended payload (
empty= confirmed delivery of this text). Reporting success on a head-truncated suffix is a broken promise. Restoring current-composer append-proof before Enter, refusing Enter on a tail, preserving the escalation buffer, and adding the reported regression matrix is restore.Constraint for a future PR (this issue can stay ready-for-pr): a new always-on 700-byte refuse-before-touching-pane changes unconfigured long
fm-senddelivery. That piece is new-default, not restore. Away-mode bounded previews plus status-file pointers for over-cap prose can sit with restore if they keep the already-promised digest honest rather than silently dropping it. Do not impose a fleet-wide hard cap that couples every backend to Claude's paste threshold; bind to selected-composer semantics, not paste pixels.VISION
fix(bin): ring steering doorbells into scrolled Herdr Claude composers (