You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Read tool cannot pass image data to vision-capable models #15728
The Read tool cannot pass image data to vision-capable models (such as qwen3.5-plus). When attempting to analyze an image file, the tool chain fails to convert the image into a proper visual input format.
Steps to Reproduce
Use opencode v1.2.15
Reference an image file using @path/to/image.png
Ask the model to analyze the image
Expected Behavior
The image should be passed to the vision-capable model for analysis.
Actual Behavior
Read tool returns Image read successfully
System error: Cannot read image (this model does not support image input)
Model never receives the image data
Environment
opencode version: 1.2.15
Model: qwen3.5-plus (vision-capable)
OS: Linux
Provider: 阿里云百炼 (Bailian)
Additional Context
The issue appears to be in the tool chain - the Read tool can read image files but cannot convert them to the proper attachment format for vision models.
Even though qwen3.5-plus natively supports vision, the Read tool's implementation only returns a success status without actually passing the image data in a format the model can process.
Suggested Fix
The Read tool should detect image files and either:
Convert them to base64 and pass as an attachment
Use the MCP attachment protocol to pass image data directly
Return an error message indicating image files cannot be processed via Read tool
Reacted by Samuel Huang, Jensen, tim-franke, Crigges, Yang Lei, OBOne, Marc Christenfeldt, Robotics Weekends, Jiehan Zheng and Phạm Hồng Phát
If your issue is specifically about the @ai-sdk/openai-compatible provider not being included in the supportsMediaInToolResults check (which is what affects Alibaba Cloud Bailian / qwen models), #13310 covers the same root cause.
I'm not sure if this is a tooling issue or if this is the agent believing that the back-end LLM model is not vision-capable. Because, when supplying already base64 encoded image data, the agent refuses to send it to the model with the same reason.
I, unfortunately, been stuck with this particular issue too.
@Clusters thank you, it works! For all JSON newbies (me included), please see if you need to add a comma in the line before modalities section. This is my full /home/username/.config/opencode/opencode.json (on Linux Mint):
Reacted by humarobot, Mike Mulhearn, Rogério Taques, subbu124, xiaohui, hungtruong1297, hyperinactive, Erlang Parasu, Andrew Miller, Felipe Santos and 2 more
Reacted by ukrospm, AbdulGafar Olamide Ajao, Andrew Miller, Felipe Santos and matt-pest-edgehog
After more testing, it seems like Claude is still able to read images, but other models tested (MiniMax, Kimi) cannot.
This is actually a severe problem for people whose workflow depends on visual understanding. The agent still attempts to read the image and there are returns coming back from the tool calls, but they don't really read it. If the agent happened to have seen the source code, they will start hallucinate the content of the images. This is disastrous for front end workflows.
A work-around for this that I used was to setup a vision mcp. I then explicitly told the agent to use that MCP for any image reads. This has worked pretty well and I was able to handle my immediate needs.
A work-around for this that I used was to setup a vision mcp. I then explicitly told the agent to use that MCP for any image reads. This has worked pretty well and I was able to handle my immediate needs.
A work-around for this that I used was to setup a vision mcp. I then explicitly told the agent to use that MCP for any image reads. This has worked pretty well and I was able to handle my immediate needs.
Activity
github-actions commentedon Mar 2, 2026
This issue might be a duplicate of existing issues. Please check:
supportsMediaInToolResultsIf your issue is specifically about the
@ai-sdk/openai-compatibleprovider not being included in thesupportsMediaInToolResultscheck (which is what affects Alibaba Cloud Bailian / qwen models), #13310 covers the same root cause.Clusters commentedon Mar 2, 2026
I'm not sure if this is a tooling issue or if this is the agent believing that the back-end LLM model is not vision-capable. Because, when supplying already base64 encoded image data, the agent refuses to send it to the model with the same reason.
I, unfortunately, been stuck with this particular issue too.
Clusters commentedon Mar 2, 2026
Got it working by adding
to the model inside opencode.json
fix(session): use image part type for images injected from tool results
mtomas7 commentedon Mar 10, 2026
@Clusters thank you, it works! For all JSON newbies (me included), please see if you need to add a comma in the line before modalities section. This is my full
/home/username/.config/opencode/opencode.json(on Linux Mint):sghng commentedon Apr 1, 2026
Got similar issue. Somehow the model does not see the image via
readtool, and will attempt to read them via playwright. This is Claude Opus 4.6.sghng commentedon Apr 1, 2026
After more testing, it seems like Claude is still able to read images, but other models tested (MiniMax, Kimi) cannot.
This is actually a severe problem for people whose workflow depends on visual understanding. The agent still attempts to read the image and there are returns coming back from the tool calls, but they don't really read it. If the agent happened to have seen the source code, they will start hallucinate the content of the images. This is disastrous for front end workflows.
roadmap: #220 filed — Image/vision input is structurally impossible a…
roadmap: #220 filed — Image/vision input is structurally impossible a…
roadmap: ultraworkers#220 filed — Image/vision input is structurally …
roadmap: ultraworkers#220 filed — Image/vision input is structurally …
subbu124 commentedon Apr 28, 2026
please see if you need to add a comma in the line before modalities, add to this inpu and output should be in small case
roadmap: ultraworkers#220 filed — Image/vision input is structurally …
roadmap: #220 filed — Image/vision input is structurally impossible a…
roadmap: #220 filed — Image/vision input is structurally impossible a…
srsaviorangell commentedon Apr 28, 2026
You tried to replicate all the changes but still with the @ and even pasting the image didn't work! unfortunately I hope they leave this natively
roadmap: ultraworkers#220 filed — Image/vision input is structurally …
kconnor1991 commentedon May 16, 2026
A work-around for this that I used was to setup a vision mcp. I then explicitly told the agent to use that MCP for any image reads. This has worked pretty well and I was able to handle my immediate needs.
Maxiviper117 commentedon May 17, 2026
Which MCP?
kconnor1991 commentedon May 17, 2026
I used this one and modified it to my model preference https://github.com/MikeyBeez/mcp-vision
github-actions commentedon Jul 17, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.