Repository navigation
fix(session): only the read tool's image payload becomes an image - #460
Merged
Merged
Conversation
split_whycodes_image_payload matched the WHYCODES_IMAGE_B64: marker anywhere in a tool result. Reading a file that mentions it (session.rs itself), or grepping for it, sent the text as an image_url part with a data:";;base64,<source text> URL, which providers reject. The marker must now open a line, name an image/ type, and be followed only by base64. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 25, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
split_whycodes_image_payloadmatchedWHYCODES_IMAGE_B64:anywhere in a tool result. Reading a file that mentions the marker (e.g.crates/session/src/session.rs), or grepping for it, turned the text into animage_urlpart:scripts/bench_tokens.pyhits this on its first read: 3,512 tokens of outline went out as an invalid data URL, which real providers reject.Fix
The payload is only recognised in the exact shape the read tool emits: the marker opens a line, names an
image/type, and is followed only by base64. Anything else stays text.Checks
cargo test -p whycodes-session --lib session::(new cases: mid-line mention, non-image type, empty subtype, non-base64 body, marker on a later line)bench_tokens.pyon a release build: request 2 now carries the outline as plain text; totals unchanged within 0.1%🤖 Generated with Claude Code