anomalyco / anomalyco/opencode

Attached AVIF images are silently dropped from model context in V2

Open
#41,722 1 comment 0 reactions 1 assignee View on GitHub

@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

  1. In the V2 TUI, paste a local .avif image path (supported by the attachment picker)
  2. The TUI inserts [Image 1] and shows the attachment
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.