The helper took a message as sent once a row of it reached the
transcript (rows > before), whatever the row held. A console that loses
part of a paste, as Windows 10's own ConPTY does (#5205), gave Claude
Code the rest, and the model answered that as the message.
Now the words the transcript records of it (a user row's text, or a
queued message's) are compared with those pasted, white space, paste
tags, image marks and format characters aside, read in place with no
copy (whole.go). The paths of images Claude Code says it took
([Image: source: <path>] meta rows) are left out and the images counted.
What Claude Code answers meanwhile is held for up to 2s. A message that
isn't whole ends the turn as Unpastable before any of its reply, so the
bridge asks it again as claude -p, as it does an image the interactive
mode didn't take.
This is 3leg0ocat's patch (github.com/3leg0ocat/magpie-lite, branch
claudetui-whole-message, b800c0cb3b), applied as written, with
TestShimCutMessageIsUnpastable added: the fake Claude Code gets a
FAKE_CUT knob that keeps only a long paste's tail past its 1024-byte
blocks, as Windows 10's conhost lost them.
Run:
- go test ./internal/claudetui ./internal/conptypair on mote (macOS):
ok. TestShimCutMessageIsUnpastable broken by hand (send returning nil
in place of checkWhole): red, the cut tail answered as "echo: ...".
- go vet ./..., GOOS=linux go vet -tags nogui ./..., GOOS=windows go
vet ./... on mote: ok (with the next commit).
- win-run go test ./internal/claudetui on xiaomi-gpu (Windows 11 26200,
whose own ConPTY keeps the marks): every test ok but
TestShimFirstMessageWaitsForTools, red on Windows at main (#4810).
3leg0ocat's own record: Windows 10 19044, Claude Code 2.1.319, Windows'
own ConPTY at 64 KB caught 4 of 4 before any reply; with ConPTY
1.25.260930003, none caught across 8/64 KB, a leading /, two images, a
queued message and two turns.
Not tried by me: Windows 10 itself (no Windows 10 box here).