Skip to content

file()/video() drop computed MIME → server sees application/octet-stream #3

Description

Severity: Medium — file()/video() don't forward the computed MIME → server sees application/octet-stream

Both builders compute mime but use it only for the blacklist check; format is added to the part only if the caller passes one. For an https-URL file/video part with no explicit format, the server has no data-URL to read the MIME from and falls back to:

// src/helpers/message.ts:318
mediaType: c.file?.format || dataUrlMime || "application/octet-stream"

So video("https://.../clip.mp4") reaches model selection as application/octet-stream, undercutting video/file support. (Data-URL parts are unaffected — the server extracts their MIME. The server only lifts MIME-by-extension for URLs found in text, not for explicit file parts.)

Fix

Always forward the computed MIME as format from file()/video() (and autoPart).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions