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
opencode run -f mislabels local file attachments as text/plain #38952
opencode run -f <path> (no --attach) always sets the attachment's mime to text/plain (or application/x-directory for a directory), regardless of the file's actual type. The correct mime is computed via FSUtil.mimeType() right above it but never used for this branch, and that call is also never awaited (it's an async function).
Effect: any non-text local attachment - an image, for example - gets sent to the model mislabeled as text/plain instead of e.g. image/png.
OpenCode version
1.18.5
Steps to reproduce
opencode run -m ollama/<vision-capable-model> --agent plan --print-logs --log-level DEBUG -f ./some-image.png -- "what does this image show?"
Check the logs: message=file mime=text/plain even though the attached file is a PNG.
Activity
github-actions commentedon Jul 26, 2026
This issue might be a duplicate of existing issues. Please check:
--file/-fflag hardcodestext/plainfor all file attachments,FSUtil.mimeType()result is discarded, breaking image uploads to vision-capable models.wonderfulremark commentedon Jul 26, 2026
Duplicate of #34318 - already reported. Closing.