Repository navigation
Description
Description
Images attached while a text-only model is active remain unusable after switching the same session to a vision-capable model.
With deepseek-v4-pro, OpenCode turns each unsupported image into a model-facing instruction to tell the user it cannot read the file. The assistant's resulting "I can't view images" answer is persisted as ordinary conversation history. If that session is then continued with deepseek-v4-flash-vision-exp, the vision model still says it has no access to the images—even though the same model correctly describes the same files in a fresh session. Reattaching the files to the continued session does not reliably recover it.
This reproduces independently with opencode run --pure, so it is not caused by a plugin or frontend attachment conversion.
Controls:
- Fresh
deepseek-v4-flash-vision-expsession with the same three PNGs: succeeds and names visible elements from all three. - Direct OpenCode Go chat-completions request with the same PNG as an
image_url: succeeds. - A local capture endpoint behind OpenCode 1.18.25 receives a valid
data:image/pngimage_url. - Same session, text-only model first and vision model second: fails consistently.
The likely boundary is unsupportedParts() in provider/transform.ts. It converts unsupported media to a textual instruction ending with Inform the user. That creates a durable assistant capability claim. On a later model switch, the historical file parts can be restored for the vision model, but the previous assistant claim is replayed too and appears to anchor the continuation.
Related but different: #39083 and #45986 concern image parts being stripped/not forwarded. In this reproduction, the outgoing request contains the image data and a fresh vision session works; the failure depends on first using a text-only model in the same conversation.
Plugins
None (--pure)
OpenCode version
1.18.25
Steps to reproduce
-
Start a session with a text-only model and attach multiple images:
opencode run --pure --model opencode-go/deepseek-v4-pro \ --file a.png --file b.png --file c.png \ "These are visual references. Describe them." -
Continue that same session with the vision model:
opencode run --pure --continue \ --model opencode-go/deepseek-v4-flash-vision-exp \ "Can you see the three previously attached screenshots? Name one visible element from each." -
Observe that the vision model says it cannot see/access the images.
-
Start a fresh
deepseek-v4-flash-vision-expsession with the same three--filearguments and prompt. It correctly describes the images. -
Optionally reattach the images in step 2's continued session; in my reproduction that still did not recover the conversation.
Expected: after switching to a model that supports image input, historical or newly reattached images should be interpreted by that model. OpenCode should not make a previous model's capability limitation durable in a way that poisons later model continuations.
Actual: the vision-capable continuation says it has no image access, while a fresh session using the same model and files succeeds.
Screenshot and/or share link
Not included because the original screenshots were private. The reproduction also succeeds with ordinary test PNGs.
Operating System
macOS 26.3 (arm64)
Terminal
OpenCode CLI (opencode run --pure)
Activity
github-actions commentedon Aug 31, 2026
This issue might be a duplicate of existing issues. Please check:
unsupportedParts()injecting an "Inform the user" instruction that persists as durable conversation history and overrides subsequent model behavior — the root cause described there appears closely related to the "poisoned continuation" mechanism you identified.If your issue is distinct (specifically the model-switch/session-continue failure mode rather than the initial substitution itself), it may still be worth leaving open, but a cross-reference with those issues would help maintainers triage.
thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊