SVG File Paths Rejected #2677

Closed
opened 2026-02-16 17:36:47 -05:00 by yindo · 7 comments
Owner

Originally created by @JuliaBonita on GitHub (Nov 7, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

When I'm trying to point the agent to an SVG file, it gets rejected with this error:
messages.72.content.1.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'

So I can't share or tell the agents to use SVG files in my instructions.

OpenCode version

1.0.41

Steps to reproduce

  1. Try to paste a file path to an SVG into OpenCode.
  2. Watch your soul get crushed from the rejection.

Screenshot and/or share link

No response

Operating System

macOS Tahoe 26.0.1

Terminal

WezTerm

Originally created by @JuliaBonita on GitHub (Nov 7, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description When I'm trying to point the agent to an SVG file, it gets rejected with this error: `messages.72.content.1.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'` So I can't share or tell the agents to use SVG files in my instructions. ### OpenCode version 1.0.41 ### Steps to reproduce 1. Try to paste a file path to an SVG into OpenCode. 2. Watch your soul get crushed from the rejection. ### Screenshot and/or share link _No response_ ### Operating System macOS Tahoe 26.0.1 ### Terminal WezTerm
yindo added the opentuibug labels 2026-02-16 17:36:47 -05:00
yindo closed this issue 2026-02-16 17:36:48 -05:00
Author
Owner

@rekram1-node commented on GitHub (Nov 7, 2025):

@JuliaBonita what provider is this? i guess we should just send them as text and that'd fix it

This looks like a message from anthropic?

@rekram1-node commented on GitHub (Nov 7, 2025): @JuliaBonita what provider is this? i guess we should just send them as text and that'd fix it This looks like a message from anthropic?
Author
Owner

@rekram1-node commented on GitHub (Nov 7, 2025):

@JuliaBonita hmm I dont think we have special svg handling are you sure it was an svg?

wait I think Dax mentioned something about images not being handled correctly maybe this is related

@rekram1-node commented on GitHub (Nov 7, 2025): @JuliaBonita hmm I dont think we have special svg handling are you sure it was an svg? wait I think Dax mentioned something about images not being handled correctly maybe this is related
Author
Owner

@JuliaBonita commented on GitHub (Nov 7, 2025):

It worked perfectly before you migrated to the recent TUI.

@rekram1-node I don't think it's Anthropic rejecting SVGs. I've never seen this problem when using Claude Code TUI directly.

It appears there is a whitelist of image types and SVG was omitted.

@JuliaBonita commented on GitHub (Nov 7, 2025): It worked perfectly before you migrated to the recent TUI. @rekram1-node I don't think it's Anthropic rejecting SVGs. I've never seen this problem when using Claude Code TUI directly. It appears there is a whitelist of image types and SVG was omitted.
Author
Owner

@rekram1-node commented on GitHub (Nov 12, 2025):

@JuliaBonita I can't replicate this, is there a specific svg that causes it?

@rekram1-node commented on GitHub (Nov 12, 2025): @JuliaBonita I can't replicate this, is there a specific svg that causes it?
Author
Owner

@JuliaBonita commented on GitHub (Nov 14, 2025):

I just upgraded to the latest version (1.0.65) and the problem still exists. All SVGs are treated the same. Here's the input and corresponding error just now from the OpenCode TUI:

This is a test:
[Image 1] 
 image/svg+xml  app/static/camera-icon.svg 
mymac (12:20:34 PM)

messages.0.content.1.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp'
@JuliaBonita commented on GitHub (Nov 14, 2025): I just upgraded to the latest version (1.0.65) and the problem still exists. All SVGs are treated the same. Here's the input and corresponding error just now from the OpenCode TUI: ``` This is a test: [Image 1] image/svg+xml app/static/camera-icon.svg mymac (12:20:34 PM) messages.0.content.1.image.source.base64.media_type: Input should be 'image/jpeg', 'image/png', 'image/gif' or 'image/webp' ```
Author
Owner

@rekram1-node commented on GitHub (Nov 14, 2025):

Ah okay I see how ur doing it, will fix

@rekram1-node commented on GitHub (Nov 14, 2025): Ah okay I see how ur doing it, will fix
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

fixed in next release: https://github.com/sst/opencode/commit/4d07034930a3ffed418b6b67e70469be2855af47

@rekram1-node commented on GitHub (Nov 26, 2025): fixed in next release: https://github.com/sst/opencode/commit/4d07034930a3ffed418b6b67e70469be2855af47
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2677