You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]:do not auto-convert image paths to attachments when the model does not support image input #42544
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Problem
When typing a path ending with an image extension (e.g. /path/to/chart_actual.png) in the TUI, opencode automatically recognizes it and attaches it as an image attachment (shown as [Image 1] in the message).
If the current model does not support multimodal/image input, the model errors out:
ERROR: Cannot read "chart_actual.png" (this model does not support image input).
Steps to reproduce
Start the opencode TUI with a text-only model (one that does not support image input).
Paste a full path ending with .png (or .jpg/.jpeg, etc.), e.g. /Volumes/RamDisk/chart_actual.png.
Send the message.
Observe: the path is auto-converted to an [Image 1] attachment, and the model errors out with "image input not supported".
Workarounds tried (all imperfect)
Adding a trailing space / wrapping in backticks / adding a text prefix (e.g. image: /path.png): still intercepted as an attachment whenever a cmd+V paste triggers.
Using a Markdown link [/path/image.png](): bypasses it, but is unintuitive and not applicable to every paste scenario.
Suggestion
Before auto-detecting a path as an image attachment, opencode should check whether the current model supports image input (i.e. whether the model's modalities include image):
Supports images: keep the current auto-attach behavior (convenient for multimodal models).
Does not support images: keep the text as-is (plain path), do not convert it to an attachment.
This issue might be a duplicate of existing issues. Please check:
Can not paste image path as text #19892: Same core issue — image paths in TUI are auto-converted to attachments with no way to paste as plain text, including for non-vision models
If your request is specifically about suppressing auto-attachment at the input stage based on model capability (rather than a general plain-text paste option), it may be distinct enough to remain open, but please review those issues first and consider whether a comment there would be more appropriate.
Activity
github-actions commentedon Aug 14, 2026
This issue might be a duplicate of existing issues. Please check:
If your request is specifically about suppressing auto-attachment at the input stage based on model capability (rather than a general plain-text paste option), it may be distinct enough to remain open, but please review those issues first and consider whether a comment there would be more appropriate.