[PR #1589] feat: Support images in tool responses #9979

Open
opened 2026-02-16 18:14:30 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opencode/pull/1589
Author: @jgontrum
Created: 8/4/2025
Status: 🔄 Open

Base: devHead: dev


📝 Commits (1)

  • a0f81ae Support images in tool responses

📊 Changes

2 files changed (+83 additions, -1 deletions)

View changed files

📝 packages/opencode/src/session/index.ts (+44 -0)
📝 packages/opencode/src/tool/read.ts (+39 -1)

📄 Description

While opencode can send images as user messages when we directly reference an image file, or drag-and-drop it, it wasn't able to analyze images programmatically.

By using multi-part tool responses, we can now let the read tool read an image and send it as a tool response. The same works for MCP servers returning images. Background: https://ai-sdk.dev/docs/foundations/prompts#multi-modal-tool-results

Note: As per the AI SDK, this is an experimental feature only supported by Anthropic.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opencode/pull/1589 **Author:** [@jgontrum](https://github.com/jgontrum) **Created:** 8/4/2025 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `dev` --- ### 📝 Commits (1) - [`a0f81ae`](https://github.com/anomalyco/opencode/commit/a0f81ae5a21a14f8b0759bdf65412dd11eb02331) Support images in tool responses ### 📊 Changes **2 files changed** (+83 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/opencode/src/session/index.ts` (+44 -0) 📝 `packages/opencode/src/tool/read.ts` (+39 -1) </details> ### 📄 Description While opencode can send images as user messages when we directly reference an image file, or drag-and-drop it, it wasn't able to analyze images programmatically. By using multi-part tool responses, we can now let the `read` tool read an image and send it as a tool response. The same works for MCP servers returning images. Background: https://ai-sdk.dev/docs/foundations/prompts#multi-modal-tool-results Note: As per the AI SDK, this is an experimental feature only supported by Anthropic. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 18:14:30 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9979