send-message.sh: false '✓ delivered' for long messages — draft detection misses wrapped input #695
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
tools/tmux/send-message.sh(framework source:packages/mosaic/framework/tools/tmux/send-message.sh) reports✓ deliveredand exits 0 when a long message is still sitting as an unsubmitted draft in the target pane's input box. The sender believes delivery succeeded; the recipient agent never sees the message.Root cause
The draft heuristic (lines ~96–101) checks whether the message tail (last 32 printable chars) appears on the last prompt-glyph line:
When a message is longer than the pane width, the input box wraps it: only the first wrapped line carries the
❯glyph (and holds the message start); the message tail sits on glyph-less continuation lines. The snippet-on-promptline check therefore misses, the loop falls through tostatus="delivered", and the swallowed-Enter draft goes undetected — the exact failure the double-Enter/verify design exists to catch.Reproduction (observed in the field, 2026-07-08)
agent-send.sh -H user@host -s <session>.✓ delivered to <session>, exit 0.tmux capture-paneconfirms the full message still on the input line(s); a manualsend-keys Enterwas required to submit it (it then landed as a queued message).Short messages are unaffected (start == tail on the
❯line), which is why this passes casual testing.Suggested fix directions
❯after the Enter flush; ordelivered.Also worth a test case in
test-send-message-socket.sh: message > pane width with a swallowed first Enter.Impact
Silent inter-agent message loss in fleet orchestration — sender proceeds on a false delivery confirmation. Exit code 2 (
still draft) exists for exactly this case but is unreachable for wrapped messages.