opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Unable to read images for some models

Open conradkoh opened this issue 1 month ago • 11 comments

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

conradkoh avatar Dec 11 '25 05:12 conradkoh

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] avatar Dec 11 '25 05:12 github-actions[bot]

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 avatar Dec 11 '25 05:12 conradkoh

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

rekram1-node avatar Dec 11 '25 05:12 rekram1-node

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 avatar Dec 17 '25 08:12 mitermayer

there isnt no

rekram1-node avatar Dec 17 '25 14:12 rekram1-node

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 avatar Dec 17 '25 20:12 MrBazzieB

@MrBazzieB what error are you seeing>

rekram1-node avatar Dec 18 '25 02:12 rekram1-node