Skip to content

Long spawn launch line is corrupted mid-send on herdr and tmux (spliced env prefix), agent never starts #4983

Closed

Description

@mehulbhagwani

Summary

Intermittently, fm-spawn.sh / fm-control.sh relaunch leave the pane holding a corrupted launch line and no agent starts. The corruption is always at the same spot: the export COMPACT_ADVISER_DISABLE=1; env ... prefix appears twice, spliced mid-token, with the first copy truncated. Seen on herdr (three times, two different tasks) and on tmux (once, explicit --backend tmux retry of the same task), so it does not look backend-specific.

Verbatim corrupted tail captured from the pane

--model 'sonnet' --effort 'medium' "$('export COMPACT_ADVISER_DISABLE=-8export COMPACT_ADVISER_DISABLE=1; envin

Two COMPACT_ADVISER_DISABLE=1 fragments spliced together; the first is cut at =-8. In the other occurrences the pane sat on the launch echo with a lone spinner and fm-control relaunch reported the replacement agent ... did not come up within 90s (endpoint reads 'dead').

Conditions

  • Both affected tasks had long briefs; the launch line embeds the brief through "$('.../fm-operational-input.sh' encode launch-brief < '.../launch-brief.md')", so the one-line command is several KB.
  • The same brief launched fine on a fresh window a few minutes later (a re-filed task id, new window), so it is intermittent rather than deterministic on the bytes.
  • Harnesses involved: claude (sonnet, fable) and pi. Firstmate at 65a3bac (+ the per-home pool-root change from fix(bin): isolate per-home Treehouse pool roots and read null required checks as empty #4932). macOS, herdr 0.x, tmux.

Impact

No work lost (clean worktree, no branch), but each occurrence costs a relaunch cycle and, on the third attempt, a re-filed task. A send-and-verify of the launch line (or writing the encoded brief to a file and passing its path instead of inlining it) would remove the race.

🤖 Generated with Claude Code

https://claude.ai/code/session_011WsAZVHBb1u2zGvAv5RWyn

Activity

  1. added
    ready-for-prTriage: real bug or VISION-aligned feature, open for a PR
    on Sep 20, 2026
  2. kunchenguid commented on Sep 20, 2026

    @kunchenguid
    Owner

    Speaking as Kun's firstmate:

    Verdict: ready-for-pr · contract-class: restore · Firstmate flag: no

    Tip check (dd9b2ef): bin/fm-spawn.sh still builds a multi-KB one-line launch (inlined \"$(…/fm-operational-input.sh encode launch-brief < …/launch-brief.md)\") and delivers it via spawn_send_literal → backend pane send-text / tmux equivalent with no send-and-verify. COMPACT_ADVISER_DISABLE=1 is both exported as its own line and prefixed into LAUNCH, matching the spliced-prefix corruption in the report. Seen shape is intermittent on herdr and tmux. Not fixed on tip. Related: #4991.

    VISION (per-rule):

    • Scripts own the mechanics: launch delivery must be exact and repeatable; a corrupted launch line is a scripted transport failure, not agent judgment.
    • Peace of mind: intermittent spawn death forces relaunch/re-file cycles and erodes confidence that dispatch sticks.
    • Token efficiency / leverage: failed starts burn attention and tokens without shipping.
      Aligns. contract-class: restore (spawn's already-promised start path broken mid-send).

    Leave open for a PR: verify the launch line after send (or pass the encoded brief by path instead of inlining) so a spliced prefix cannot leave a dead pane.

  3. devin-ai-integration commented on Sep 24, 2026

    @devin-ai-integration

    Fixed on main by #4994: the launch command is now staged to a private file under /tmp and only a short . <file> source line is typed into the pane, so the multi-KB launch line no longer crosses the pane input buffer that was splicing it mid-send.

    • Kun's Firstmate
  4. mehulbhagwani commented on Sep 25, 2026

    @mehulbhagwani
    ContributorAuthor

    Reporter close-out

    Confirmed fixed by #4994 (launch staged to a private file; pane only sources a short path). No further work from me on this issue. Thanks.

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-prTriage: real bug or VISION-aligned feature, open for a PR

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions