Skip to content

Herdr+Claude typed delivery can submit only the TAIL of a long message (away-mode digests and fm-send steers arrive head-truncated, reported as success) #3473

Closed

Description

@3264studios

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 (current origin/main at 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.sh inject_msg -> bin/fm-backend.sh typed delivery -> bin/backends/herdr.sh one pane send-text call, 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)

  1. Refuse any typed payload above a conservative cap (700 UTF-8 bytes) before touching a pane.
  2. 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.
  3. 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).
  4. If the proof fails or only a tail is present: do not press Enter, preserve the escalation buffer, report the truncation verdict.
  5. 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

  1. added
    ready-for-pr
    on Sep 1, 2026
  2. kunchenguid commented on Sep 1, 2026

    @kunchenguid
    Owner

    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

    Current main delivery path

    fm_backend_herdr_send_text_submit (bin/backends/herdr.sh ~2790) still: one pane send-text, settle, Enter, then confirm via native working / composer empty / queued-Enter. It never extracts the selected current composer or proves the intended payload was appended before Enter. A suffix that then submits still yields empty (success). inject_msg in bin/fm-supervise-daemon.sh treats that empty as 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-send delivery. 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

    1. One captain, one interface — aligns (a truncated away-mode digest hides a failure/escalation while reporting success).
    2. Authority is explicit — aligns (restore promised integrity; the 700-byte cap must not assume consent as a new default).
    3. Scripts own the mechanics — aligns (composer proof is exact script work, not agent judgment).
    4. A restart is a non-event — aligns (keep the durable source; preserve the buffer on truncation).
    5. Delegation with a spine — aligns (explicit delivery contract: the receiver gets the instruction that was sent).
    6. The fleet outlives any vendor — aligns if the proof is composer-semantic; a Claude-only always-on byte cap as fleet default would not.
    7. Scope — aligns (command-layer delivery integrity; field incident becomes regression coverage).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-pr

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions