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
[BUG]: Pasting an image file path is auto-detected as image input instead of text #32014
When pasting an image file path (e.g., /path/to/screenshot.png) into opencode CLI, it is automatically captured as an image input rather than treated as plain text. This makes it impossible to reference image file paths as text.
Expected Behavior
There should be a way to paste an image file path as plain text without it being interpreted as an image attachment — for example, wrapping in backticks, or a toggle to disable image detection.
Actual Behavior
The content is captured as an image message, and the model receives: ERROR: Cannot read "filename.png" (this model does not support image input). The textual path is never accessible to the model.
Steps to Reproduce
Copy a local image file path string (e.g., ~/Downloads/screenshot.png)
Paste it into opencode CLI
The path is recognized as an image reference instead of text
Environment
opencode CLI (latest)
macOS 15
Additional Context
This was encountered while trying to ask the model to copy an image to a specific directory and embed it in a markdown file. The file path could not be communicated because it was always intercepted as an image.
This issue might be a duplicate of existing issues. Please check:
Can not paste image path as text #19892: Same bug — pasting an image file path into the TUI is auto-parsed as an image reference instead of plain text, making it impossible to use the path as text input.
Environment: Windows 11, opencode 1.18.18 (VS Code extension + Windows Terminal).
I use "Copy as path" then paste into the prompt, and it's immediately converted to [image 1] instead of the text path. My model doesn't support image input, so I have no way to reference the file path as text.
Please add an option to paste a file path as plain text.
Same issue here (text-only model, pasting /Volumes/RamDisk/chart_actual.png in the TUI gets auto-converted to an [Image 1] attachment, then errors with ERROR: Cannot read "chart_actual.png" (this model does not support image input)).
Workarounds tried — all imperfect: trailing space, backticks, text prefix (e.g. image: /path.png) are still intercepted when the line ends with an image extension; only a Markdown link [/path/image.png]() bypasses it.
Suggestion: before auto-detecting a path as an image attachment, check whether the current model's modalities include image; if not, keep it as plain text.
Closing as a duplicate of #19892, which tracks pasted image file paths always becoming attachments instead of plain text. Please add your use case and 👍 there.
Activity
github-actions commentedon Jun 12, 2026
This issue might be a duplicate of existing issues. Please check:
github-actions commentedon Aug 12, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
thanh-abaii commentedon Aug 14, 2026
Same issue here.
Environment: Windows 11, opencode 1.18.18 (VS Code extension + Windows Terminal).
I use "Copy as path" then paste into the prompt, and it's immediately converted to [image 1] instead of the text path. My model doesn't support image input, so I have no way to reference the file path as text.
Please add an option to paste a file path as plain text.
qiqingli commentedon Aug 14, 2026
Same issue here (text-only model, pasting
/Volumes/RamDisk/chart_actual.pngin the TUI gets auto-converted to an[Image 1]attachment, then errors withERROR: Cannot read "chart_actual.png" (this model does not support image input)).Workarounds tried — all imperfect: trailing space, backticks, text prefix (e.g.
image: /path.png) are still intercepted when the line ends with an image extension; only a Markdown link[/path/image.png]()bypasses it.Suggestion: before auto-detecting a path as an image attachment, check whether the current model's
modalitiesincludeimage; if not, keep it as plain text.Related: #42544
neriousy commentedon Oct 1, 2026
Closing as a duplicate of #19892, which tracks pasted image file paths always becoming attachments instead of plain text. Please add your use case and 👍 there.