Skip to content

SVG File Paths Rejected #4052

Closed
Closed

Description

@JuliaBonita

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 7, 2025
  2. rekram1-node commented on Nov 7, 2025

    @rekram1-node
    Contributor

    @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?

  3. self-assigned this
    on Nov 7, 2025
  4. rekram1-node commented on Nov 7, 2025

    @rekram1-node
    Contributor

    @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

  5. JuliaBonita commented on Nov 7, 2025

    @JuliaBonita
    Author

    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.

  6. rekram1-node commented on Nov 12, 2025

    @rekram1-node
    Contributor

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

  7. JuliaBonita commented on Nov 14, 2025

    @JuliaBonita
    Author

    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'
    
  8. rekram1-node commented on Nov 14, 2025

    @rekram1-node
    Contributor

    Ah okay I see how ur doing it, will fix

  9. rekram1-node commented on Nov 26, 2025

    @rekram1-node
    Contributor

    fixed in next release: 4d07034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions