Read tool accesses JPEG file but vision model hallucinates incorrect description (no actual image content processed) #8122

Open
opened 2026-02-16 18:09:13 -05:00 by yindo · 1 comment
Owner

Originally created by @randomvibecoder on GitHub (Jan 31, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

The read tool successfully locates and claims to read a JPEG image file. Instead of using the native vision model of the LLM, the read tool returns a base64 encoding of the image (not suitable for LLMs).
This causes the LLM to hallucinate image details.
OpenCode fails to recognize if a model has native vision capabilities.

Plugins

No response

OpenCode version

1.1.47

Steps to reproduce

  1. Place a JPEG image file, (e.g. imgtest.jpg in the current directory, do not name it what the image has, as the LLM would guess correctly)
  2. Ask the model to describe the image, do not give it any hints
  3. The model fails to answer correctly, when asked what it received, it states it has received a bas64 string

Screenshot and/or share link

Image

Operating System

Ubuntu 24.04.3 LTS

Terminal

OpenCode Desktop v1.1.45

Originally created by @randomvibecoder on GitHub (Jan 31, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description The `read` tool successfully locates and claims to read a JPEG image file. Instead of using the native vision model of the LLM, the `read` tool returns a `base64` encoding of the image (not suitable for LLMs). This causes the LLM to hallucinate image details. OpenCode fails to recognize if a model has native vision capabilities. ### Plugins _No response_ ### OpenCode version 1.1.47 ### Steps to reproduce 1. Place a JPEG image file, (e.g. `imgtest.jpg` in the current directory, do not name it what the image has, as the LLM would guess correctly) 2. Ask the model to describe the image, do not give it any hints 3. The model fails to answer correctly, when asked what it received, it states it has received a bas64 string ### Screenshot and/or share link <img width="1554" height="966" alt="Image" src="https://github.com/user-attachments/assets/4cf938b8-f71a-43c0-a676-77a28cb472f1" /> ### Operating System Ubuntu 24.04.3 LTS ### Terminal OpenCode Desktop v1.1.45
yindo added the bug label 2026-02-16 18:09:13 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Jan 31, 2026):

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

  • #11306: Read tool fails to read image files even with vision-capable models (paste works) - Very similar issue where the Read tool doesn't properly handle images for vision-capable models
  • #11304: Images returned from Read tool don't work with OpenAI-compatible providers - Also describes problems with Read tool image handling and base64 encoding
  • #5359: Unable to read images for some models - Reports inability to read images and issues with base64 encoding
  • #4983: AI_APICallError - base64 encoded image pasted - Related to base64 encoding issues with images

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

@github-actions[bot] commented on GitHub (Jan 31, 2026): This issue might be a duplicate of existing issues. Please check: - #11306: Read tool fails to read image files even with vision-capable models (paste works) - Very similar issue where the Read tool doesn't properly handle images for vision-capable models - #11304: Images returned from Read tool don't work with OpenAI-compatible providers - Also describes problems with Read tool image handling and base64 encoding - #5359: Unable to read images for some models - Reports inability to read images and issues with base64 encoding - #4983: AI_APICallError - base64 encoded image pasted - Related to base64 encoding issues with images Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8122