Skip to content

feat(ui): display image attachments from tool results - #21352

Closed
neilli418 wants to merge 2 commits into
anomalyco:devfrom
neilli418:feat/tool-result-image-display
Closed

neilli418 wants to merge 2 commits into
anomalyco:devfrom
neilli418:feat/tool-result-image-display

Conversation

@neilli418

@neilli418 neilli418 commented Apr 7, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #21227

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Tool results can include image attachments (typed as FilePart with an image mime type), but the UI currently doesn't display them. This PR adds clickable image thumbnails below completed tool results.

How did you verify your code works?

Tested with MCP tools and the built-in webfetch tool that return image attachments. Verified:

  • Thumbnails appear below the tool result when images are present
  • Clicking opens full-size preview in the dialog
  • Non-image attachments are unaffected
  • No rendering when tool is still running

Screenshots / recordings

Screenshot 2026-04-07 at 11 17 25 AM Screenshot 2026-04-07 at 11 17 12 AM Screenshot 2026-04-07 at 11 30 47 AM

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@rekram1-node

Copy link
Copy Markdown
Collaborator

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

@rasperepodvipodvert

Copy link
Copy Markdown

Auto-closed by the cleanup bot rather than on review — CI passed 11/11 and the implementation directly addresses #21227. Could a maintainer reopen for review?

@bernhardberger

Copy link
Copy Markdown

I’m hitting this in OpenCode web: image attachments from tool results are not rendered in the chat UI, so the practical workaround is exposing the image through a temporary URL and pasting a link.

#21352 looks like the narrow UI fix for this general class of tool-result image attachments. I checked it against current dev today (b2a06351b) and it still merges conflict-free; the patch only touches packages/ui/src/components/message-part.tsx and packages/ui/src/components/message-part.css.

Since this was auto-closed rather than reviewed/rejected, could it be reopened for review? Happy to help test or open a fresh rebased PR if maintainers prefer.

@johnwmail

Copy link
Copy Markdown

Please review and don't close

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE(app)]: display image attachments from tool results in chat UI

6 participants