You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Upload to Provider sends archives, Office files and some text types as file parts the provider rejects (400 on every later turn) #16472
With "Upload to Provider", some files on the built-in supportedMimeTypes list go to the provider as file parts that the provider always rejects. The provider answers 400. The file stays in the history, so every later turn of the conversation fails the same way.
Measured through a LiteLLM proxy, with an OpenAI file part and data:<mime>;base64,...:
Azure's error: Invalid file data: 'messages[0].content[1].file.file_data'. Expected a base64-encoded data URL with a supported file MIME type, for example 'data:application/pdf;base64,...'. Vertex's error: Unable to submit request because it has a mimeType parameter with value application/vnd.openxmlformats-officedocument.wordprocessingml.document, which is not supported.
The file picker's accept is images and PDF, but "All files" in the OS dialog bypasses it, and drag-and-drop accepts the file too.
Cause. An endpoint with no supportedMimeTypes of its own inherits the built-in list (mergeWithDefault). That list also serves Code Environment and File Search, so it includes zip, tar, sql, sh, json, yaml, docx/xlsx/pptx and epub. The document branch of processAttachments (api/app/clients/BaseClient.js) and of the child-run encoder (packages/api/src/agents/files/encode.ts) accept any file on that list. #13550 made this deliberate for OpenAI, so CSV and XLSX reach the Responses API (#13547). But some types on the list can never go inline:
archives (zip, tar, gzip, epub, octet-stream), on every provider;
application/sql, x-sh and xml on Azure OpenAI, and every textual application/* type on Gemini.
The encoder already knows "Claude behind a gateway" by the model name (#14650, #16055). Gemini has no such branch.
Suggested fix. Keep the inherited list as the provider opt-in (#13550). Skip archives unless the endpoint lists them itself. Filter Gemini to PDF and text, as #14535 does for Claude. Send the textual types above as a text part (File: "<name>"\n\n<contents>), unless the endpoint lists them. PR to follow.
Version Information
Image registry.librechat.ai/danny-avila/librechat:v0.8.8-rc3. The code is unchanged in v0.8.8-rc4 and on dev (c8c5478).
Custom OpenAI-compatible endpoints pointed at a LiteLLM proxy, fileConfig.legacyFileUploadUX: true, no supportedMimeTypes on the endpoint.
Steps to Reproduce
Configure a custom endpoint for Azure OpenAI (or Gemini) through an OpenAI-compatible gateway. Do not set supportedMimeTypes on it.
Pick "Upload to Provider", choose "All files" in the OS dialog, and attach query.sql (Gemini: report.docx).
Send a message. The provider returns 400.
Send another message. It fails again, because the file is re-sent from history.
What happened?
With "Upload to Provider", some files on the built-in
supportedMimeTypeslist go to the provider as file parts that the provider always rejects. The provider answers 400. The file stays in the history, so every later turn of the conversation fails the same way.Measured through a LiteLLM proxy, with an OpenAI
filepart anddata:<mime>;base64,...:gpt-5-mini)application/sql,application/x-sh,application/xml,application/zip,application/octet-streamtext/plain,text/csv,text/markdown,text/html,text/x-python,application/json,application/yaml,application/typescript, docxgemini-flash-lite-latest)application/sql,application/json,application/yaml,application/xml,application/typescripttext/plain,text/csv,text/markdown,text/html,text/x-pythonAzure's error:
Invalid file data: 'messages[0].content[1].file.file_data'. Expected a base64-encoded data URL with a supported file MIME type, for example 'data:application/pdf;base64,...'. Vertex's error:Unable to submit request because it has a mimeType parameter with value application/vnd.openxmlformats-officedocument.wordprocessingml.document, which is not supported.The file picker's
acceptis images and PDF, but "All files" in the OS dialog bypasses it, and drag-and-drop accepts the file too.Cause. An endpoint with no
supportedMimeTypesof its own inherits the built-in list (mergeWithDefault). That list also serves Code Environment and File Search, so it includes zip, tar, sql, sh, json, yaml, docx/xlsx/pptx and epub. The document branch ofprocessAttachments(api/app/clients/BaseClient.js) and of the child-run encoder (packages/api/src/agents/files/encode.ts) accept any file on that list. #13550 made this deliberate for OpenAI, so CSV and XLSX reach the Responses API (#13547). But some types on the list can never go inline:application/sql,x-shandxmlon Azure OpenAI, and every textualapplication/*type on Gemini.The encoder already knows "Claude behind a gateway" by the model name (#14650, #16055). Gemini has no such branch.
Suggested fix. Keep the inherited list as the provider opt-in (#13550). Skip archives unless the endpoint lists them itself. Filter Gemini to PDF and text, as #14535 does for Claude. Send the textual types above as a text part (
File: "<name>"\n\n<contents>), unless the endpoint lists them. PR to follow.Version Information
registry.librechat.ai/danny-avila/librechat:v0.8.8-rc3. The code is unchanged in v0.8.8-rc4 and ondev(c8c5478).fileConfig.legacyFileUploadUX: true, nosupportedMimeTypeson the endpoint.Steps to Reproduce
supportedMimeTypeson it.query.sql(Gemini:report.docx).What browsers are you seeing the problem on?
No response
Relevant log output
No response
Screenshots
No response
Code of Conduct