Unable to read images for some models
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
- Screenshot an image
- Paste into opencode
Screenshot and/or share link
No response
Operating System
macOS 26.1 Tahoe
Terminal
VSCode
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.
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"] }
}
{
was it custom or is it one that we show in models.dev
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 ?
there isnt no
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 what error are you seeing>