anomalyco / anomalyco/opencode
Attached AVIF images are silently dropped from model context in V2
@jlongster is already working on this.
Since Aug 11, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
In OpenCode V2, pasting or @-mentioning an AVIF image attachment in the TUI inserts an [Image N] mention label, but the image is silently dropped when building the model request: to-llm-message.ts only forwards image/png, image/jpeg, image/gif, and image/webp as media, and attachmentContent returns [] for any other image mime. The model sees the [Image N] label but never receives the image content, so it may hallucinate or fail to work with the attachment. The TUI file picker explicitly supports .avif (see local-attachment.ts mime table), so the format is accepted on input but vanishes on output.
Environment
- opencode version: v2 (next)
- OS: macOS
- Install/channel: next
Reproduction
- In the V2 TUI, paste a local
.avifimage path (supported by the attachment picker) - The TUI inserts
[Image 1]and shows the attachment - Submit the prompt and inspect the model request: no media part and no text fallback for the image
Related: #17772 requested AVIF support or auto-conversion; the format is still dropped today. Unsupported formats like image/tiff hit the same path.
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.