GeezerVison is showing github.com — [FEATURE(app)]: display image attachments from tool results in chat UI · Issue #21227 · anomalyco/opencode
[FEATURE(app)]: display image attachments from tool results in chat UI #21227DescriptionFeature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
When a tool returns image data — via webfetch fetching an image URL, or an MCP server returning an ImageContent block — the image is stored in part.state.attachments and correctly forwarded to the model via the supportsMediaInToolResults pipeline in message-v2.ts. However, the image is never rendered in the chat UI. The user has no visual feedback that a tool produced image output.
Current behavior
Images in part.state.attachments are invisible in the UI. The only indication something happened is the tool call row (e.g. "Called webfetch") with no image shown.
Expected behavior
Images from tool result attachments render inline below the tool call row, with click-to-fullscreen preview — consistent with how user-uploaded image attachments are displayed in UserMessage.
Proposed fix
In ToolPartDisplay (message-part.tsx), after the tool component renders, check part.state.attachments for entries where mime.startsWith("image/") and render them using the existing dialog.show(() => <ImagePreview .../>) pattern. CSS scoped to [data-component="tool-part-wrapper"].
- No new dependencies
- No changes outside
packages/ui
- Applies to all tools that populate
attachments — built-in (webfetch, read) and MCP alike
Related
Reacted by bm, zhboner, Emmanuel Deloget, filatovzru, Pavel, Bernhard Berger, Andreas Hald, Ali MoezGholami, TheOriginal92, Mauricio Scheffer and 5 more Reacted by Bernhard Berger and Alex Gvozden Activityadded coreAnything pertaining to core functionality of the application (opencode server stuff) on Apr 6, 2026zhboner commented on Apr 8, 2026 Besides gemini images, standard markdown image format, e.g., is not supported in UI either. :( removed discussionUsed for feature requests, proposals, ideas, etc. Open discussion coreAnything pertaining to core functionality of the application (opencode server stuff) on May 3, 2026bernhardberger commented on May 29, 2026 I’m also hitting this in OpenCode web: image attachments from tool results are not rendered in the chat UI, so I have to expose the image through a temporary URL and paste a link instead.
#21352 appears to address this directly and still merges conflict-free against current dev. AndreasHald commented on Jul 15, 2026 Would love this aswell, I can ask the ai to take screenshots from my phone via Opencode web, but it can't show me the screenshot TheOriginal92 commented on Aug 31, 2026 Another concrete case for this: I drive a fairly large MCP stack from opencode web (1.18.5 in Docker), and several of those tools return screenshots.
The pipeline works right up to the last step. session/tools.ts turns MCP image content into a data:<mime>;base64,… attachment, it lands in part.state.attachments, the SDK exposes it on SessionMessageToolStateCompleted, and the model receives it. Only the UI drops it, so the images are invisible to the person sitting in front of the session — which is exactly the case where you want to see them.
Worth noting the same data path also covers the built-in read tool, which builds identical data URIs in tool/read.ts. A UI-side fix would therefore cover both without touching the server.
There are now two closed PRs for this (#21352 and #38846), both closed by the automated cleanup without a review, plus one open draft (#39817). Since the contributing guidelines route UI features through a design review first: is there a preferred direction from the team? Happy to test whichever lands. Reacted by Yves Renier, Mauricio Scheffer and Alex Gvozden opencodejr commented on Oct 29, 2026 Thanks for the detailed request, @neilli418!
To restate it: when a tool returns an image (an MCP ImageContent block, or webfetch on an image URL), the image is sent to the model but never shown in the chat. You'd like it shown under the tool call, with click-to-preview like user-attached images.
The current v2 app still works this way. The tool row shows only the text parts of a tool's result. The one exception is the read tool, which loads its image from disk. Image results from MCP tools and webfetch aren't displayed. Maintainers will consider this.
Related:
This can't be built as a GUI plugin yet, because the plugin API has no way to render tool results.
devicbest commented on Nov 15, 2026 Same symptom here (from #64012): a local MCP tool returning [ImageContent(png), TextContent] renders the image inline on the Android app, but the Desktop app (2.3.0, Windows 11) shows only the text block \u2014 the image is silently dropped, same session on both clients. So the server/transport delivers it; only the desktop timeline row ignores non-text parts. Happy to provide logs or a minimal repro MCP server if it helps. VRMX6557 commented on Nov 19, 2026 Reproduced on current Desktop 2.3.2 (Windows 11 Pro, release/latest). Updates to the existing report:
- Not limited to MCP/webfetch —
experimental_image_generate results are dropped too (configured with opencode/grok-imagine-image-2.0). Generation succeeds; only the Desktop timeline drops the media.
- The
read exception mentioned in the maintainer bot comment no longer holds on 2.3.x: reading a PNG via read also does not display the image in the Desktop timeline.
- Same session renders images correctly on Android; Desktop shows text/path only (matches Desktop app drops MCP image content blocks (Android renders them) #64012, closed as duplicate on 2026-11-15).
- No image-related errors in main.log / renderer.log — only
[server-request-queue] server thrashing detected.
- Plugins ruled out: ./plugins/tools-gate, @tarquinen/opencode-dcp, @joe-broadhead/opencode-mem.
Workaround until fixed: tools.browser.preview({ path }) opens the saved image in the Desktop Review pane, which renders it correctly. Confirmed on 2.3.2. Reacted by Ernesto Martínez Gómez ulab commented on Nov 22, 2026 Independent repro on opencode Desktop v2.3.2 (macOS) with a real MCP server — adds a control case and a second client
Setup: prusa-mcp (Prusa Connect printer fleet). The camera_snapshot tool returns the latest camera JPEG as an image content block, plus a text metadata block.
- The image reaches the model: the agent described the frame contents in detail (objects, text within the frame, positions) — server→model transport is intact.
- Nothing shows in the chat UI: only the tool row with the text metadata — no thumbnail, no attachment indicator, no error.
- Control case in the same conversation: images attached to regular agent replies (file paths) render fine — so the drop is specific to tool-result image attachments (
state.attachments), not image rendering in general.
- Second client: identical behavior on OpenChamber (a macOS client built on the opencode UI stack) — both front-ends share the timeline renderer, consistent with the Oct 29 confirmation and the Nov 15/19 Desktop reports in this thread.
- Workaround that works on both clients: save the image to disk and attach the file in the reply (or open it in the Review pane, per @VRMX6557).
psourdea-lgtm commented on Nov 24, 2026 +1 — same problem on OpenCode Desktop 2.x, Linux (Ubuntu 24.04, x86_64, .deb install).
Use case: a remote MCP server (Cisco UC administration) exposes a phone_screenshot tool that captures the display of a Cisco IP phone. The tool result contains only an MCP image content block, no text:
{
"content": [
{ "type": "image", "data": "<base64 PNG>", "mimeType": "image/png" }
]
}
Observed:
- The model receives the image correctly (it can describe the phone screen in detail), so the server and transport are fine.
- In the Desktop timeline the tool call only shows
Called <tool> host=... ip_phone=...; the image is never rendered, whatever the Timeline settings (detail level, "Other tools" Group on/off, etc.).
- Same behaviour when the tool is called through Code Mode
execute: the script returns null and the image is only forwarded to the model.
Expected: MCP ImageContent blocks rendered inline (or expandable) in the tool row, as the Android client already does (#64012).
For tools whose main output is an image (screenshots, charts, diagrams), the user currently has no way to see the result in the Desktop app.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|