Files
magpie/docs
yetone bca0d6d69a claudetui: a turn's images are pasted as files, not sent to claude -p
A request with images ran claude -p, and a turn with one ended the
interactive run. The helper now writes each base64 image to
image-N.<ext> (0600) in a magpie-claude-images-* temp folder and pastes
its path alone, which Claude Code 2.1.314 reads into the message as
[Image #N]; a path inside other words stays words. Claude Code reads the
file after the paste returns, so the helper waits for [Image #N] past the
last one before pasting the next piece. The folder is removed when the
helper ends. Only an image known by its URL still goes to -p
(urlImages), and tuiPromptMost counts words without images.

Run: go test ./internal/claudetui ./internal/cli on mote and in WSL
magpie-desktop, ok; go test -run 'TestClaudeTUI|TestSubscription|
TestClaudePrint' ./internal/gateway on mote, ok; go vet ./..., GOOS=linux
go vet -tags nogui ./..., GOOS=windows go vet ./..., go build, gofmt -l,
ok. Real account (Claude Code 2.1.314, haiku, sandbox HOME) through the
sandbox gateway with tools: a red then a blue square in two turns, 3 of 3
answered red, blue; the transcript has image blocks in both user rows,
entrypoint cli, and the second turn went on in the same run.
Broken by hand: without the wait for [Image #N], TestShimPastesImages
loses the second image.
Not tried: an image over Claude Code's size limit; Linux with a real
account.
2026-10-31 05:00:39 +08:00
..