Description
When OpenCode reads AVIF images (e.g., from downloaded Webflow assets) and sends them to the Anthropic API for vision/multimodal analysis, the API rejects them because AVIF is not a supported media type.
Steps to Reproduce
- Have AVIF images in a directory (e.g., downloaded from Webflow)
- Use an agent with multimodal capabilities to analyze the images
- The agent reads the
.avif file and sends it to the API
Expected Behavior
OpenCode should either:
- Auto-convert AVIF to a supported format (PNG/JPEG/WebP) before sending to the API
- Or skip unsupported formats gracefully with a clear warning
Actual Behavior
The API returns a validation error in an infinite loop:
messages.502.content.0.tool_result.content.1.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'
Additionally, if the file doesn't exist:
ENOENT: no such file or directory, open '/tmp/wf-imgs/659d681d7b333c788f3209b2_patrick-riedel_square.avif'
The agent enters a retry loop hitting the same error repeatedly.
Additional Context
- AVIF is increasingly common on modern websites (Webflow, Squarespace, etc.)
- macOS has native AVIF→PNG conversion via
sips -s format png input.avif --out output.png
- The Anthropic API supports:
image/jpeg, image/png, image/gif, image/webp
Environment
- OpenCode v1.2.26
- macOS (Darwin 25.3.0)
- Anthropic API via Quotio proxy
Description
When OpenCode reads AVIF images (e.g., from downloaded Webflow assets) and sends them to the Anthropic API for vision/multimodal analysis, the API rejects them because AVIF is not a supported media type.
Steps to Reproduce
.aviffile and sends it to the APIExpected Behavior
OpenCode should either:
Actual Behavior
The API returns a validation error in an infinite loop:
Additionally, if the file doesn't exist:
The agent enters a retry loop hitting the same error repeatedly.
Additional Context
sips -s format png input.avif --out output.pngimage/jpeg,image/png,image/gif,image/webpEnvironment