Files
magpie/docs
yetone c867a12c5b claude: a client sending earlier turns' images back still goes on in its run
Yqihotaru (X) keeps a long conversation on claude-opus-5-5 through the
bridge, and their client takes the images of earlier turns out of some
requests and sends them back in others: the log's image count flips
between 2 and 4, every turn says "no run here has had this conversation",
and a new Claude Code starts from a transcript each time, so the prompt
cache is lost every turn.

lostMedia (#1382) took only images taken out, and looseTurn compared the
last turn alone with the whole history before it hashed exactly. Now
mediaMoved compares the conversation one role's run of messages at a
time, either way (images taken out, or put back where nothing or a line
of text stood). follows uses it for tool results; looseTurn keeps the
whole conversation and its settings apart, and rewrote takes a request
with the same settings whose images alone moved, in any turn. A sealed
tool result keeps the last 2KB of its words so one sent back without the
client's line is told from one changed otherwise.

Run (mica): go test ./internal/gateway (whole package, -tags nogui,
-timeout 45m) ok; go vet, GOOS=linux go vet -tags nogui, GOOS=windows go
vet of internal/gateway ok; gofmt -l clean. Rebased on origin/main f5f27070a (only a Gemini
slash-model change in gateway since); at that head the image, lost-media,
loose-turn and Gemini slash tests run again ok on mica.
Broken by hand: on the old matching (lostMedia in follows, no put-back in
mediaMoved) TestClaudeImagesComingAndGoingInEarlierTurnsGoOnInTheRun is
red at turn 2 ("2 runs") in both subtests, with the reporter's log lines,
and the sent-back cases of TestClaudeToolResultsAfterTheImagesSentBackGoOn
and TestMediaMovedIsOnlyImagesComingAndGoing are red.
Not tried: the reporter's real client or a real Claude account; the full
./... suite (gateway package only). branch() and whyNoRun still compare
exact hashes. A run that never had an image the client sends back goes on
without it, answering from the gap or line it was told before.
2026-11-16 13:20:43 +08:00
..