LibreChat/api/server/services/Files
JOJO e49cb798da
🪢 fix: Keep One Code File per Sandbox Destination (#15817)
* 🪢 fix: Keep One Code File per Sandbox Destination

Codeapi mounts a by-ref input at the filename recorded on the stored
object (the file server's Content-Disposition) and only falls back to the
`name` sent in `/exec` when that header is absent. The `<stem>-<hash>`
alias `claimCodeDestination` handed to an older same-name file was
therefore remapped onto the bare name inside the sandbox, and the whole
request was rejected with "Conflicting input destinations" — on every
later turn, because nothing came back to collapse the pair. Any
conversation in which code rewrote an uploaded file in place, or the user
re-uploaded a file under its original name, lost code execution for good.

`primeFiles` now reserves each destination with `reserveCodeDestination`
in newest-content-first order and skips the files that lose, before the
freshness probe so a dropped file is never re-uploaded. This is the same
collapse `seedCodeFilesIntoSessions` and `ToolNode.updateCodeSession`
already apply. The spec stub mirrors the real directory-prefix rule so the
ancestor case is covered at this layer too.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix: preserve stored sandbox destinations during priming

* test: remove unused mock transport imports

* fix: recover unnamed legacy inputs and converted images safely

* fix: keep freshness decisions paired with mount destinations

* fix: align recovery destinations with upload and route boundaries

* style: format upload receipt regression fixture

* fix: distinguish stored paths from proposed recovery paths

* fix: preserve lazy provisioning destination priority and recovery names

* fix: reconcile recovery names with live code destinations

* fix: distinguish recoverable destinations from superseded scoped content

* fix: guard optional request user in recovery scope check

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Co-authored-by: Danny Avila <danny@librechat.ai>
2026-09-10 15:13:38 -04:00
..
Audio 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
Azure 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
Citations 🛤️ fix: Align File Search Citation Paths (#15650) 2026-09-06 17:25:47 -04:00
Code 🪢 fix: Keep One Code File per Sandbox Destination (#15817) 2026-09-10 15:13:38 -04:00
Firebase 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
images 🏷️ fix: Record the Media Type of Saved Images, Not the Declared One (#15606) 2026-09-04 11:51:28 -04:00
Local 🪣 refactor: Rate-Limit Token Routes and Cap Remote File Downloads (#13978) 2026-06-26 12:19:03 -04:00
OpenAI
VectorDB 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
index.js
permissions.js 🧱 fix: Enforce Agent Runtime File Trust Boundaries (#14577) 2026-08-02 14:18:28 -04:00
permissions.spec.js 🧱 fix: Enforce Agent Runtime File Trust Boundaries (#14577) 2026-08-02 14:18:28 -04:00
process.integration.spec.js
process.js 🛟 fix: Recover CodeAPI File Uploads After Throttling (#15784) 2026-09-09 15:48:11 -04:00
process.spec.js 🛟 fix: Recover CodeAPI File Uploads After Throttling (#15784) 2026-09-09 15:48:11 -04:00
provision.js 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
provisionCallback.js 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
retention.js ⏳ fix: Separate Temporary and General Chat Retention (#15734) 2026-09-08 11:22:54 -04:00
retention.spec.js ⏳ fix: Separate Temporary and General Chat Retention (#15734) 2026-09-08 11:22:54 -04:00
routing.js 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
saveBase64Image.spec.js 🏷️ fix: Record the Media Type of Saved Images, Not the Declared One (#15606) 2026-09-04 11:51:28 -04:00
strategies.js 🗄️ refactor: Honor All-Data Retention for Agent Files (#13424) 2026-05-30 22:32:22 -04:00