Trying to read an invalid image file bricks the session #6869

Open
opened 2026-02-16 18:05:28 -05:00 by yindo · 5 comments
Owner

Originally created by @mmkal on GitHub (Jan 19, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Hello! I found this bug by my application being dumb and writing some HTML to a .jpeg file. It breaks opencode, seemingly unrecoverably (other than by starting a new session).

Reproduction:

echo hello > /tmp/piccy.jpeg
opencode
# ask "what's in the image at /tmp/piccy.jpeg"
# "Could not process image"
# All prompts now get "Could not process image"

Plugins

None

OpenCode version

1.1.25

Steps to reproduce

  1. Write some text to a file with extension ".jpeg"
  2. Ask opencode to look at it

Screenshot and/or share link

Image

https://opncd.ai/share/XlzI18MI

Operating System

MacOS 26.1 (25B78), but also happens on node:24 docker image

Terminal

Ghostty, also sh in docker

Originally created by @mmkal on GitHub (Jan 19, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Hello! I found this bug by my application being dumb and writing some HTML to a .jpeg file. It breaks opencode, seemingly unrecoverably (other than by starting a new session). Reproduction: ```sh echo hello > /tmp/piccy.jpeg opencode # ask "what's in the image at /tmp/piccy.jpeg" # "Could not process image" # All prompts now get "Could not process image" ``` ### Plugins None ### OpenCode version 1.1.25 ### Steps to reproduce 1. Write some text to a file with extension ".jpeg" 2. Ask opencode to look at it ### Screenshot and/or share link <img width="817" height="748" alt="Image" src="https://github.com/user-attachments/assets/a4e9ef95-45b1-4432-b57a-0b67fc857986" /> https://opncd.ai/share/XlzI18MI ### Operating System MacOS 26.1 (25B78), but also happens on `node:24` docker image ### Terminal Ghostty, also sh in docker
yindo added the bug label 2026-02-16 18:05:28 -05:00
Author
Owner

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

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

  • #5359: Unable to read images for some models - also related to image processing errors that may affect session state
@github-actions[bot] commented on GitHub (Jan 19, 2026): This issue might be a duplicate of existing issues. Please check: - #5359: Unable to read images for some models - also related to image processing errors that may affect session state
Author
Owner

@mmkal commented on GitHub (Jan 20, 2026):

No, it's not a duplicate of that one.

@mmkal commented on GitHub (Jan 20, 2026): No, it's not a duplicate of that one.
Author
Owner

@GeneCodeSavvy commented on GitHub (Jan 21, 2026):

I have opened a PR, and happy re-iterate for any changes

@GeneCodeSavvy commented on GitHub (Jan 21, 2026): I have opened a PR, and happy re-iterate for any changes
Author
Owner

@colinmollenhour commented on GitHub (Feb 6, 2026):

It's slightly different for me - my image file was 0 bytes:

Image
@colinmollenhour commented on GitHub (Feb 6, 2026): It's slightly different for me - my image file was 0 bytes: <img width="1287" height="1264" alt="Image" src="https://github.com/user-attachments/assets/31cb66ce-aecb-4722-9d35-624ab011f2dc" />
Author
Owner

@sameed-khan commented on GitHub (Feb 8, 2026):

Adding that the same thing happens if the model reads an image that is too large (> 5MB)

@sameed-khan commented on GitHub (Feb 8, 2026): Adding that the same thing happens if the model reads an image that is too large (> 5MB)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6869