anomalyco / anomalyco/opencode
[BUG]: interactive image file part is persisted but not always forwarded to the model
@kitlangton is already working on this.
Since Jul 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
An image attached to an interactive session can be stored as a valid image/png file part, while the next assistant response still says it cannot inspect the image and asks for a local path.
I confirmed this from a sanitized session record: the user message contains a type: "file" part with mime: "image/png", a data: URL, and source metadata. The immediately following response used a vision-capable OpenAI model but behaved as if no image content reached it.
This appears intermittent or specific to an interactive input path. As a control, both of these succeed on the same installation and accurately read text, colors, and shapes from a synthetic PNG:
opencode run --pure --model "openai/gpt-5.6-luna" "Describe the attached image" --file test.png
opencode run --model "openai/gpt-5.6-sol" "Describe the attached image" --file test.png
Expected: if the session has a valid image/* file part and the selected model supports image input, the image is forwarded as multimodal input. The model should not ask for a filesystem path.
Actual: the attachment is visible in persisted session parts, but the model sometimes responds as though it was not provided.
Related issues checked, but they cover different boundaries: #29216 (non-vision model/MCP delegation), #20802 and #33542 (custom OpenAI-compatible capability metadata), #37581 (application/octet-stream in Desktop), and #34318 (run -f MIME detection).
Plugins
oc-codex-multi-auth (the successful non---pure control also used the configured plugins)
OpenCode version
1.18.5
Steps to reproduce
- Start an interactive OpenCode session with a model whose
capabilities.input.imageis enabled. - Attach or reference a PNG so that the resulting user message contains an
image/pngfile part. - Ask the model to describe an unambiguous detail visible only in the image.
- Inspect a sanitized export with
opencode export --sanitize <session-id>. - Observe that the file part may be present as an
image/pngdata URL even though the response says the image is unavailable and asks for its path. - Run the same model and image through
opencode run --file; in my control this works correctly.
I cannot determine from the persisted session metadata whether the failing interactive message originated from TUI, Desktop/Web, or another client because no client/frontend field is stored. Adding that field to sanitized diagnostics would also make this class of issue easier to isolate.
Screenshot and/or share link
Not included because the original image/session may contain private data. The finding above comes from --sanitize output; no data URL or local path is included.
Operating System
macOS 26.5.2 (arm64)
Terminal
iTerm2
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.