Unable to read images for some models #3461

Open
opened 2026-02-16 17:40:10 -05:00 by yindo · 11 comments
Owner

Originally created by @conradkoh on GitHub (Dec 11, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When I paste an image into opencode, it keeps telling me that it cannot read images, after it has been attached. On version 1.0.134 it works, but not on 1.0.137 onwards.

This is the stack

  • Backend: LiteLLM + Vertex AI

OpenCode version

1.0.143

Steps to reproduce

  1. Screenshot an image
  2. Paste into opencode

Screenshot and/or share link

No response

Operating System

macOS 26.1 Tahoe

Terminal

VSCode

Originally created by @conradkoh on GitHub (Dec 11, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When I paste an image into opencode, it keeps telling me that it cannot read images, after it has been attached. On version 1.0.134 it works, but not on 1.0.137 onwards. This is the stack - Backend: LiteLLM + Vertex AI ### OpenCode version 1.0.143 ### Steps to reproduce 1. Screenshot an image 2. Paste into opencode ### Screenshot and/or share link _No response_ ### Operating System macOS 26.1 Tahoe ### Terminal VSCode
yindo added the bug label 2026-02-16 17:40:10 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 11, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #5056: opus not able to read images with read tool
  • #2825: "I cannot analyze or describe image files" error when trying to use image output files
  • #2937: Image analysis support issues on Windows

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 11, 2025): This issue might be a duplicate of existing issues. Please check: - #5056: opus not able to read images with read tool - #2825: "I cannot analyze or describe image files" error when trying to use image output files - #2937: Image analysis support issues on Windows Feel free to ignore if none of these address your specific case.
Author
Owner

@conradkoh commented on GitHub (Dec 11, 2025):

I looked further into the issue and found that it works if I set the input modality to include image. So I think this might be an issue with the detection of models + modalities.

The particular case I faced: claude-sonnet-4-5-20250929 was not being detected as a model that could support images.

For those interested, the property to set was:

{
  "<model>": {
    //...
    "modalities": { "input": ["image", "text"], "output": ["text"] }
  }
{
@conradkoh commented on GitHub (Dec 11, 2025): I looked further into the issue and found that it works if I set the input modality to include image. So I think this might be an issue with the detection of models + modalities. The particular case I faced: `claude-sonnet-4-5-20250929` was not being detected as a model that could support images. For those interested, the property to set was: ```jsonc { "<model>": { //... "modalities": { "input": ["image", "text"], "output": ["text"] } } { ```
Author
Owner

@rekram1-node commented on GitHub (Dec 11, 2025):

was it custom or is it one that we show in models.dev

@rekram1-node commented on GitHub (Dec 11, 2025): was it custom or is it one that we show in models.dev
Author
Owner

@mitermayer commented on GitHub (Dec 17, 2025):

Is there a setting on opencode to set "default_image_model" to handle image inputs when the current model is not able to process it ?

@mitermayer commented on GitHub (Dec 17, 2025): Is there a setting on opencode to set "default_image_model" to handle image inputs when the current model is not able to process it ?
Author
Owner

@rekram1-node commented on GitHub (Dec 17, 2025):

there isnt no

@rekram1-node commented on GitHub (Dec 17, 2025): there isnt no
Author
Owner

@MrBazzieB commented on GitHub (Dec 17, 2025):

I get this error when using us.anthropic.claude-haiku-4-5-20251001-v1:0 and even us.anthropic.claude-sonnet-4-5-20250929-v1:0 but using global.anthropic.claude-opus-4-5-20251101-v1:0 works fine. Weirdly, when I switch back from Opus to Sonnet, it is able to read the image again.

@MrBazzieB commented on GitHub (Dec 17, 2025): I get this error when using `us.anthropic.claude-haiku-4-5-20251001-v1:0` and even `us.anthropic.claude-sonnet-4-5-20250929-v1:0` but using g`lobal.anthropic.claude-opus-4-5-20251101-v1:0` works fine. Weirdly, when I switch back from Opus to Sonnet, it is able to read the image again.
Author
Owner

@rekram1-node commented on GitHub (Dec 17, 2025):

@MrBazzieB what error are you seeing>

@rekram1-node commented on GitHub (Dec 17, 2025): @MrBazzieB what error are you seeing>
Author
Owner

@mitermayer commented on GitHub (Dec 20, 2025):

@rekram1-node Is this something that the opencode team would consider ? In similar veins to the "small_model" having a "vision_model" could be interesting too

@mitermayer commented on GitHub (Dec 20, 2025): @rekram1-node Is this something that the opencode team would consider ? In similar veins to the "small_model" having a "vision_model" could be interesting too
Author
Owner

@rekram1-node commented on GitHub (Dec 20, 2025):

I think u can accomplish this via plugins, make a hook for on tool output, check if it has attachments, drop them from the tool call and instead call an llm to explain the image and say what it is or something

@rekram1-node commented on GitHub (Dec 20, 2025): I think u can accomplish this via plugins, make a hook for on tool output, check if it has attachments, drop them from the tool call and instead call an llm to explain the image and say what it is or something
Author
Owner

@rekram1-node commented on GitHub (Dec 20, 2025):

but yeah maybewe need something better for that behavior

@rekram1-node commented on GitHub (Dec 20, 2025): but yeah maybewe need something better for that behavior
Author
Owner

@MrBazzieB commented on GitHub (Dec 24, 2025):

@MrBazzieB what error are you seeing>

@rekram1-node I am not seeing any error, other than this message:

I'm unable to read image files directly as I don't have image input capabilities. However, I can help you in other ways:
1. Use an OCR tool - You could use an external tool to extract text from the image and paste it here
2. Describe the error - Tell me what error you're seeing and I can help troubleshoot
3. Check the file - Since the image is at /path/to/image.png, it seems to be related to a report error in your application
Could you describe what error is shown in the image, or paste any error messages you're seeing? That way I can help you fix the issue.
▣  Build · us.anthropic.claude-sonnet-4-5-20250929-v1:0 · 7.3s

When I switch to OPUS, it is able to read the image, and when I switch back to SONNET it is able to read the image. I then went ahead and got OPENCODE to debug the issue and search the logs, this is what it told me:

Based on the logs, I found the issue. The error message about the image appears to be generated client-side by >OpenCode, not from the actual logs. Here's what I found:
What happened with the image:
The log shows that when you tried to attach the image /path/to/image.png, OpenCode detected that:

  1. The model being used (us.anthropic.claude-sonnet-4-5-20250929-v1:0 via Amazon Bedrock) does not support image >input
  2. OpenCode intercepted this before sending the request to the API
  3. It displayed the error message: ERROR: Cannot read "/path/to/image.png" (this model does not support image input)
    Why this happened:
    The error log shows AI_APICallError entries around the same timestamp (2025-12-23T15:34:16 and 2025-12->23T20:03:41), indicating the model was trying to process your request but couldn't handle the image attachment.
    Solution:
    To share images with me, you have a few options:
  4. Describe the error - Tell me what you see in the image
  5. Use a vision-capable model - Switch to a model that supports images (like Claude Sonnet 4 via Anthropic direct, or GPT->4 Vision)
  6. Extract text - Use OCR to extract any text from the image and paste it here
    What error are you seeing in the /path/to/image.png image? I'm happy to help troubleshoot once you describe
@MrBazzieB commented on GitHub (Dec 24, 2025): > [@MrBazzieB](https://github.com/MrBazzieB) what error are you seeing> @rekram1-node I am not seeing any error, other than this message: ``` I'm unable to read image files directly as I don't have image input capabilities. However, I can help you in other ways: 1. Use an OCR tool - You could use an external tool to extract text from the image and paste it here 2. Describe the error - Tell me what error you're seeing and I can help troubleshoot 3. Check the file - Since the image is at /path/to/image.png, it seems to be related to a report error in your application Could you describe what error is shown in the image, or paste any error messages you're seeing? That way I can help you fix the issue. ▣ Build · us.anthropic.claude-sonnet-4-5-20250929-v1:0 · 7.3s ``` When I switch to OPUS, it is able to read the image, and when I switch back to SONNET it is able to read the image. I then went ahead and got OPENCODE to debug the issue and search the logs, this is what it told me: > Based on the logs, I found the issue. The error message about the image appears to be generated client-side by >OpenCode, not from the actual logs. Here's what I found: >What happened with the image: >The log shows that when you tried to attach the image /path/to/image.png, OpenCode detected that: >1. The model being used (us.anthropic.claude-sonnet-4-5-20250929-v1:0 via Amazon Bedrock) does not support image >input >2. OpenCode intercepted this before sending the request to the API >3. It displayed the error message: ERROR: Cannot read "/path/to/image.png" (this model does not support image input) >Why this happened: >The error log shows AI_APICallError entries around the same timestamp (2025-12-23T15:34:16 and 2025-12->23T20:03:41), indicating the model was trying to process your request but couldn't handle the image attachment. >Solution: >To share images with me, you have a few options: >1. Describe the error - Tell me what you see in the image >2. Use a vision-capable model - Switch to a model that supports images (like Claude Sonnet 4 via Anthropic direct, or GPT->4 Vision) >3. Extract text - Use OCR to extract any text from the image and paste it here >What error are you seeing in the /path/to/image.png image? I'm happy to help troubleshoot once you describe
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3461