Repository navigation
Render images agents produce in the conversation (#39) - #60
Merged
currentbits merged 3 commits intoAug 15, 2026
Merged
Conversation
… Kept-alive Claude CLIs: 30-minute idle hold with no cap
… Budget exhaustion kills orchestration silently
A tool_result carrying an image block (Read of a PNG, a Playwright screenshot) was JSON.stringified into the tool output, so the user saw a truncated base64 blob and never the picture. Images now go to userData/tool-images (never into the store JSON, which is rewritten in full on every event) and the tool message carries the file names; the tool card fetches them as data URLs when it opens. Co-Authored-By: Claude Opus 5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
currentbits
deleted the
coder/images-produced-by-agents-are-not-displa-fde965
branch
October 3, 2026 16:07
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.
Fixes #39.
Why
An agent could take a screenshot and Read it back, reason about it perfectly, and the user saw nothing — just the tool call and a text description. Every visual verification workflow (UI changes, screenshot diffs, design review) ended with "open the PNG from /tmp by hand".
Root cause
flattenContent(electron/claude.js) folded every non-text content block throughJSON.stringify. An image block became truncated base64 in the tool output pane, and the bytes were dropped everywhere else. Nothing downstream ever knew an image existed.What changed
electron/tool-images.js(new):extractImages/saveToolImages/readToolImage. Bytes are written touserData/tool-images, never into the store JSON — that is one file rewritten in full on every event, and a full-page screenshot in there would be brutal.readToolImagetakes abasenameonly, so a name from the renderer can never traverse.electron/runner.js: thetool_resulthandler saves any image blocks and records the filenames ontool.images. Its two near-duplicate branches (pairedmsgIdvs. fallback lookup bytool.id) collapsed into one, so both paths get the fix rather than just the one the repro happened to take.files:imagechannel returns a data URL (the app's CSP allowsdata:, notfile:), wired through preload / wireClient / devCoder / useCoder / App toToolCallCard, which fetches lazily the first time the card is expanded.[image]instead of a wall of base64.Scope is the Claude path: codex, opencode and kimi parse their own text-only tool output and never carry image blocks.
Verification
electron/test/tool-images.test.js: extraction, disk round-trip to a data URL, and rejection of traversal / non-image names.electron/test/claude.test.js: a newtool-imagefake-CLI scenario emits a Read-of-a-PNGtool_result— the file lands on disk byte-identical, the message holds only the filename, and no base64 appears anywhere in the transcript.test/threadView.test.tsx: mounted card renders no<img>while collapsed; after a click it requests the image and renders<img src="data:image/png;base64,…">.tsc --noEmitclean. Renderer suite 741 pass / 0 fail. Electron suite 714 pass / 9 fail — those 9 (memory-sup, orch-server) fail identically onmainwith these changes stashed.Verified by tests, not by looking at the running app: launching a second Electron instance would share userData with the live one.
Known gap: image files are never pruned (marked with a
ponytail:comment). Nothing else in userData is pruned either; an age sweep on boot is the fix if the directory ever grows.