Repository navigation
Composer: leave a file the browser names as another format to the server - #2872
Merged
Merged
Conversation
The browser's type for a file is whatever the computer registered for its extension. A .pdb protein structure is chemical/x-pdb on Linux, and a Windows machine with chemistry software names .mol and .cif too, though each is plain text. The composer refused any type that named a format OpenBot doesn't take, so those files never reached the server, which reads the bytes and takes text as text. Only images are refused by name now (an SVG, a HEIC), as the server refuses them. Every other type goes to the server, held to the largest limit, and a file that isn't text (a .zip, an old .doc) is refused there by its bytes.
davidmckayv
marked this pull request as ready for review
December 3, 2026 16:50
davidmckayv
requested review from
MikeRyanDev,
dustywusty,
guidovizoso,
mxmzb,
samjulien and
tylerslaton
as code owners
December 3, 2026 16:50
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
A customer's protein structure was refused when they attached it: "'model2.pdb' isn't a file type OpenBot can read (application/x-pilot)". A
.pdbis plain text.The browser's type for a file is whatever the computer registered for its extension. On Linux a
.pdbischemical/x-pdb, a browser's own table can call itapplication/x-pilot(a Palm Pilot database), and a Windows machine with chemistry software installed names.moland.ciftoo, though every one of them is text. The composer refused any type that named a format OpenBot doesn't take, so those files never reached the server, which reads the bytes and takes text as text.Now the composer refuses only images by name (an SVG, a HEIC), as the server does. Every other type goes to the server, held to the largest limit. A file that isn't text (a
.zip, an old.doc) is refused there by its bytes, in the server's words. The cost is a round trip before a truly unreadable file is refused. That is the same trade the composer already made for a file the browser couldn't name.No API or database change.
shared/is unchanged.Red before, green after
app/src/components/channels/composer/picked-files.test.ts, withpicked-files.tsput back tomain: 4 fail, 21 pass..pdbaschemical/x-pdbandapplication/x-pilot,.cif,.xyz,.mol,.xml,.yaml,.sh)With the fix: 25 pass. The composer and attachment suites under
app/testspass too (168).End to end, Chrome and Safari
The real product on a fresh stack, with this branch's web app: a stock AG-UI agent (the AG-UI repository's own OpenAI Agents example, unmodified) connected as a Bot, a
model2.pdband a1crn.cifattached in a new conversation and sent. Both files are staged with no refusal, both are on the sent message and still there after a reload, the agent receives every line of each as text, and it answers "They describe crambin." Passed in Chromium and in WebKit.On
main, the same steps: the composer refuses the.pdbat pick time ("'model2.pdb' isn't a file type you can attach."), the message goes without the files, and the Bot answers "I don't see the attached files here".Changelog
Conversations.
.pdb,.cif,.xyz,.mol,.xmland.yaml, can now be attached. The composer leaves a file it can't name to the server, which reads its bytes: text is taken as text, and anything else is refused there.