Skip to content

Composer: leave a file the browser names as another format to the server - #2872

Merged
davidmckayv merged 1 commit into
mainfrom
fix/plaintext-science-uploads
Dec 3, 2026
Merged

davidmckayv merged 1 commit into
mainfrom
fix/plaintext-science-uploads

Conversation

@davidmckayv

@davidmckayv davidmckayv commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

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 .pdb is plain text.

The browser's type for a file is whatever the computer registered for its extension. On Linux a .pdb is chemical/x-pdb, a browser's own table can call it application/x-pilot (a Palm Pilot database), and a Windows machine with chemistry software installed names .mol and .cif too, 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, with picked-files.ts put back to main: 4 fail, 21 pass.

  • lets a text file the browser names as another format through for the server to read (.pdb as chemical/x-pdb and application/x-pilot, .cif, .xyz, .mol, .xml, .yaml, .sh)
  • holds a file the browser names as another format to the larger ceiling
  • a zip goes to the server, which refuses it by its bytes
  • leaves the older Office formats to the server, and the dialog does not offer them

With the fix: 25 pass. The composer and attachment suites under app/tests pass 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.pdb and a 1crn.cif attached 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 .pdb at 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.

  • Plain text files whose extension the computer names as another format, such as .pdb, .cif, .xyz, .mol, .xml and .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.

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
davidmckayv marked this pull request as ready for review December 3, 2026 16:50
@davidmckayv
davidmckayv added this pull request to the merge queue Dec 3, 2026
Merged via the queue into main with commit 1d3713c Dec 3, 2026
98 of 107 checks passed
@davidmckayv
davidmckayv deleted the fix/plaintext-science-uploads branch December 3, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant