Files
magpie/internal/claudetui/testdata/paste-images-2.1.319.bin
T
yetone 8fa3c60f80 claude: an interactive run takes many images between words (#5654)
Chapin2018's message of nineteen images between words (the issue's
script, Claude Code 2.1.319, claude-fable-5-1) ended the interactive
helper "after 13s (exit status 1)" and the client got a 502, while -p
answered. The cause is how the helper saw a paste taken. It looked for
"[Image #N]" and "[Pasted text #N" only in what Claude Code drew after
the paste. Once the prompt runs past a row, Claude Code draws it again
only where it changed and moves the cursor past cells that are already
right. After the 33rd piece the drawing held "\r\x1b[16C\x1b[1B3": one
digit of "[Image #33]". The helper waited out pasteWait (10s) and ended.
Text marks came out in part too ("[Pasted t xt #16"), so several word
pieces each sat out their own 10s before that. There is no limit in
Claude Code's TUI: the same paste is on its screen whole, so no -p
fallback is needed.

Each check now also reads the prompt as the 200x50 screen grid shows
it: the rows between its last two rules, words one space apart (a mark
can wrap onto the next row). The mark that ends it counts (lastMark),
an image's [Image #N] or a whole [Pasted text #N +k lines], numbered
past the piece before, and so do words the prompt ends with. The
stream check stays first.

Run:
- Real, macOS arm64, this Mac, sandbox HOME and CLAUDE_CONFIG_DIR
  (token by env, nothing rotated, DISABLE_AUTOUPDATER=1), the issue's
  script unchanged, --images 19, Claude Code 2.1.319:
  - origin/main a46190e1f: exit 1 after ~32s, stderr as reported.
    2.1.316 failed the same way. -p: success, 5.8s.
  - This change: exit 0 in 5.3 to 12.1s on 5 runs, subtype success.
    The transcript's user row has all 19 image blocks and the words in
    order, and the model answered. The script's answer_ok stays false
    because the helper's result line has no "result" text (-p's does).
    The gateway reads the assistant events, not that field.
- TestShimSeesPastesOnAPromptDrawnInPart feeds the real run's bytes
  (testdata/paste-images-2.1.319.bin, folder name replaced at the same
  length). Each of the 33 pastes must be seen taken.
- Broken by hand: drop the prompt checks from imageTaken and textTaken
  and it goes red on text 12, text 22 and image 33, the pieces whose
  marks were drawn in part.
- WSL magpie-desktop (Ubuntu 24.04 amd64, go1.26.8), because mote is
  down:
  - gofmt -l . is clean.
  - go vet -tags nogui ./... and GOOS=windows go vet ./... pass. Plain
    vet there lacks gtk4 headers.
  - go test ./internal/claudetui/ is ok (120s).
  - The darwin build used for the real runs above.

Not tried: Linux arm64 (the reporter's system) with a real account, the
gateway's /v1/messages path end to end with 19 images, and the full
suite (not run at push).

Refs #5654: kept open for the reporter to confirm.

Reported-by: Chapin2018
2026-11-08 18:24:16 +08:00

1 line
10 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
78[?25h[?2004h[?2031h[?1004h[<u[>5u[>4;2m]0;✳ Claude Code\[?1049h[<u[>5u[>4;2m[?1000h[?1002h[?1003h[?1006h[?25l[?25l[?2026h
 ▐▛███▛█Claude Codev2.1.319
▝▜██████▀Fable 5.1 · Claude API
 ▝▝ ▝▝ /home/user/wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww/work
● high · /effort
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ Try "fix lint errors"
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
⏸ manual mode on · ? for shortcuts · ← for agents[?25h[?2026l[>0q[?u]7501;?\[?2026h[?25l
ctrl+g to edit in Vim
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ Syntheticimage1.


[?25h[?2026l[?2026h[?25l
Pasting…[?25h[?2026l[?2026h[?25l
[Image#1]
⏸ manual mode on[?25h[?2026l[?2026h[?25l
[Pastedtext#2+4lines]
paste gain to expand[?25h[?2026l[?2026h[?25l
[Image#3]
Ping…[?25h[?2026l[?2026h[?25l
[Pastedtext#4+4lines]
pe again to expand[?25h[?2026l[?2026h[?25l
[Image#5][?25h[?2026l[?2026h[?25l
[Pastedtext#6+4lines][?25h[?2026l[?2026h[?25l
[Image#7][?25h[?2026l[?2026h[?25l
[Pastedtext#8+4lines][?25h[?2026l[?2026h[?25l
[Image#9][?25h[?2026l[?2026h[?25l
[Pastedtext#10+4lines][?25h[?2026l[?2026h[?25l
[Image#11][?25h[?2026l[?2026h[?25l
ctrl+g to edit in Vim
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ Synthetic image 1.

[Image#1][Pastedtext#2+4lines][Image#3][Pastedtext#4+4lines][Image#5][Pastedtext#6+4lines][Image#7][Pastedtext#8+4lines][Image#9][Pastedtext#10+4lines][Image#11][Pasted
text #12 +4 lins][?25h[?2026l[?2026h[?25l
 ●high · /effort[?25h[?2026l[?2026h[?25l
⏸ manul mode on[?25h[?2026l(B[?2004h[<u[>5u[>4;2m[?1000h[?1002h[?1003h[?1006h[?2026h[?25l
[Image#13][?25h[?2026l[?2026h[?25l
[Pastedtext#14+4lines]
paste gain to expand[?25h[?2026l[?2026h[?25l
[Image#15][?25h[?2026l[?2026h[?25l
[Pastedtext#16+4lines][?25h[?2026l[?2026h[?25l
[Image#17][?25h[?2026l[?2026h[?25l
[Pastedtext#18+4lines][?25h[?2026l[?2026h[?25l
[Image#19][?25h[?2026l[?2026h[?25l
[Pastedtext#20+4lines][?25h[?2026l[?2026h[?25l
[Image#21][?25h[?2026l[?2026h[?25l
● high · /effort
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ Synthetic image 1.

[Image#1][Pastedtext#2+4lines][Image#3][Pastedtext#4+4lines][Image#5][Pastedtext#6+4lines][Image#7][Pastedtext#8+4lines][Image#9][Pastedtext#10+4lines][Image#11][Pasted
text #12 +4 lins][Image #13][Pasted text14 +4 lines][Image #15][Pasted txt #16 +4 lins][Image#17][Pasted text #18 +4lines][Image #19Pastd text #20 +4 lines][Image #21][Psted text #22 +4
lines][?25h[?2026l[?2026h[?25l
[?25h[?2026l[?2026h[?25l
⏸ manul mode on[?25h[?2026l(B[?2004h[<u[>5u[>4;2m[?1000h[?1002h[?1003h[?1006h[?2026h[?25l
[Image#23][?25h[?2026l[?2026h[?25l
[Pastedtext#24+4lines]
paste gain to expand[?25h[?2026l[?2026h[?25l
[Image#25]
Ping…[?25h[?2026l[?2026h[?25l
[Pastedtext#26+4lines]
pe again to expand[?25h[?2026l[?2026h[?25l
[Image#27][?25h[?2026l[?2026h[?25l
[Pastedtext#28+4lines][?25h[?2026l[?2026h[?25l
[Image#29][?25h[?2026l[?2026h[?25l
[Pastedtext#30+4lines][?25h[?2026l[?2026h[?25l
[Image#31][?25h[?2026l[?2026h[?25l
[Pastedtext#32+4lines][?25h[?2026l[?2026h[?25l
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯ Synthetic image 1.

[Image#1][Pastedtext#2+4lines][Image#3][Pastedtext#4+4lines][Image#5][Pastedtext#6+4lines][Image#7][Pastedtext#8+4lines][Image#9][Pastedtext#10+4lines][Image#11][Pasted
text #12 +4 lins][Image #13][Pasted text14 +4 lines][Image #15][Pasted txt #16 +4 lins][Image#17][Pasted text #18 +4lines][Image #19Pastd text #20 +4 lines][Image #21][Psted text #22 +4
lines][Image #23][Pastedtext #24 +4lines][Image #25][Pastedtext #26 +4lines][Image #27][Pastedtext #28 +4lines][Image #29][Pastedtext #30 +4lines][Image #31][Pastedtext #32 +4
3[?25h[?2026l[?2026h[?25l
⏸ manul mode on[?25h[?2026l