Repository navigation
Conversation
Opening a tool call whose result holds images (a Read of a .png, a
screenshot tool) showed only "[image]". The detail now names the result's
pictures (images: [{n, line, mediaType}], never their bytes; line is where
each stands in the output, also once its middle is cut), and the box serves
each one from the conversation's record at GET
…/transcript/tool/{id}/image/{n} (and a helper's …/subagents/{id}/tool/
{tool}/image/{n}): PNG, JPEG, GIF and WebP only. The app fetches them once
the row is open, through boxBlob, as thumbnails that open at full size; a
picture it can't get stays "[image]".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@Stener1 is attempting to deploy a commit to the seanbrydonio's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
Opened as a draft because the author's ready-PR limit is full; it is marked ready automatically when a slot frees. I can't add the |
This branch has not been deployed
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.
Summary
Opening a tool call that returned a picture (a
Readof a .png, an MCP screenshot tool) showed only[image]. It now shows the picture: a thumbnail (up to 320 px tall) where[image]stood, which opens at full size on a click.The picture comes from the conversation's own record (the
tool_result's base64 image block), not from the file. So it shows for files outside the worktree (/tmp/…), and for files changed or deleted since.GET …/sessions/{name}/transcript/tool/{id} - { output: "…\n[image]", … } + { output: "…\n[image]", images: [{ n: 0, line: 1, mediaType: "image/png" }], … } # never the bytes +GET …/sessions/{name}/transcript/tool/{id}/image/{n} # the bytes, Content-Type image/* +GET …/sessions/{name}/subagents/{id}/tool/{tool}/image/{n} # the same for a helper's call<ToolRow> (conversation-view.tsx) <ToolDetailView image={…}> - <pre>{output}</pre> + outputParts(output, images) (lib/tool-images.ts: each picture at its line) + <pre>{text}</pre> + <ToolImage n load name> (tool-image.tsx: boxBlob → blob URL, fetched once the row opens) + <Dialog> full sizeinternal/transcript/detail.go):Detaillists the result's pictures in the same pass that reads its text, and skips their data.lineis where each picture stands inoutput: its own[image]line, or the… more lines …line when a long output's middle is cut. So a text block that itself reads[image]stays text.Imagedecodes only picture n and stops reading at the result. It serves only PNG, JPEG, GIF and WebP (nosniff, a sandbox CSP,Cache-Control: private, immutable).boxBlob, because a plain<img src>can't carry the token. Anything the box can't give back (the record rotated past its 32 MB window, another type) shows[image]as before. It shows no toast for this.Evidence
The real app is driven against a dev box of this branch (
.claude/skills/verify-berthd, newfeatures/chat-tool-calls.md, scenariochat-tool-image-live). A real Claude Code reads a synthetic/tmp/acme-shot.png(480x300) from the chat.Before (main's berthd + main's app, same box): the Read opens to
[image].After (terminal driver): the Read opens to the picture. Its
naturalWidthis 480, and the row shows no[image]text.After: a click opens it at full size, and Escape closes it.
After:
/tmp/acme-shot.pngis deleted, then the row is closed and opened again. The picture still shows, read from the record (screenshot).After (structured driver, where the chat is berthd's own host log): the same scenario passes (screenshot).
Second view: the scenario fetches
…/transcript/tool/{id}/image/0through the agent. Its body is byte-for-byte the PNG Claude read, withContent-Type: image/png. The console shows no errors.Tests:
Checks run locally (fork PRs wait for approval before CI runs):
go vet ./...,go test -race ./...,pnpm check:*,pnpm test(632),pnpm build,npx tsc -p e2e, the touched e2e specs, anddocs-sitebuild.TestSleepDurable(internal/box/runs) failed once under load and passed 5/5 when rerun.keyboard.spec.ts"⌘⇧E puts the keyboard in the Files panel" fails onorigin/mainas well.cargo check. This box lacks the GTK dev libraries, and no Rust changed.Merge Danger
Door: two-way
A new GET route and an additive JSON field. Nothing is written anywhere, so a revert removes the change cleanly. An older app ignores
images, and an older box sends none, so the app shows[image]as before.Blast Radius: chat
checkout-result.png). "a tool call opens to what it did" looks for "Read 3 files".🤖 Generated with Claude Code