Skip to content

[Bug]: SVG image attachments are rejected by T3 Code #10936

Description

@CPRewrite

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/web

Steps to reproduce

  1. Open T3 Code.
  2. Start or open a conversation.
  3. Drag an SVG to the composer.

Expected behavior

It should attach the SVG as an attachment.

Actual behavior

The composer refuses the SVG with an error message

SVGNAME is not a supported image type. Attach GIF, HEIC, HEIF, JPEG, PNG, or WebP images.
This prevents me to add SVG for designs.

Impact

Major degradation or frequent failure

Version or commit

0.0.41-nightly.20260908.1400

Environment

Windows 11

Logs or stack traces

Screenshots, recordings, or supporting files

No response

Workaround

A workaround is to rename the extension to txt or html or something.

Activity

  1. added
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 9, 2026
  2. juliusmarminge commented on Sep 9, 2026

    @juliusmarminge
    Member

    Thanks for the report — this is working as designed after the #6020 fix, but the design-file request is a reasonable follow-up (not a wash duplicate).

    What happens today
    The composer classifies anything under image/* that providers cannot take as a vision image as unsupported-image and refuses it at attach time. SVG (image/svg+xml) is in that bucket, along with TIFF.

    That check lives in apps/web/src/components/chat/composerAttachmentFiles.ts / ChatComposer.tsx, backed by PROVIDER_SEND_TURN_SUPPORTED_IMAGE_MIME_TYPES in packages/contracts (GIF, JPEG, PNG, WebP). HEIC/HEIF are a special convert-to-raster path. Mobile uses the same rule.

    Why it exists
    #6020 accepted SVG, then Claude failed with Unsupported Claude image attachment type 'image/svg+xml'. #6574 / 93376e45 moved that failure to attach time on purpose. Tests still say “reject unsupported image types instead of attaching them as generic files.”

    What you want
    Attaching SVG source for designs is a different path. The server already accepts { type: "file", mimeType: "image/svg+xml" } as a generic file, and Claude/OpenCode only send raster types as vision — other files ride as a prompt path. Your rename-to-.txt/.html workaround works because that skips the image/* reject and uses the file path.

    Not doing

    Next
    Product call (@julius) on whether to keep the hard reject or add an SVG exception that stages it as a generic file (not an image). Rasterizing to PNG would not preserve design source. Served-SVG XSS is already sandboxed (#5916).

    Until then, attach via rename, or put the .svg in the workspace and mention the path.

  3. added
    enhancementRequested improvement or new capability.
    via-triageFiled through npx t3 triage
    and removed
    bugSomething is broken or behaving incorrectly.
    needs-triageIssue needs maintainer review and initial categorization.
    on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementRequested improvement or new capability.needs-juliusvia-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions