LibreChat/api/server/services/Files/Code
Danny Avila 858e2371f9
📦 fix: Reuse Unchanged Code Snapshots and Batch the Uploads a Turn Still Needs (#18564)
* 📦 fix: Reuse Unchanged Code Snapshots and Batch the Uploads a Turn Still Needs

Every generated-file snapshot in a conversation was uploaded to the Code API again on each turn that used the code tool, one request per file, so a conversation holding about as many files as the upload limiter allows could no longer run code.

A snapshot is now mounted from the object uploaded earlier while the object store still reports the bytes that upload sent, on routes that mount stored objects for every execution. Files that do need uploading share one /upload/batch request. A rate-limited turn reports once, and an upload that never reached the Code API is a known outcome rather than a claim kept for manual recovery.

* fix: Keep Unanswered Batch Files Uncertain and Bound What a Batch Holds

A file the Code API left out of a batch answer, or confirmed without an object id, may still have been stored, so only the service's own per-file error releases its claim.

The batch allowance is now charged with the bytes actually read across the whole batch, so records that understate their size cannot make one request hold more than it may carry; the excess is streamed.
2026-11-19 22:34:01 -05:00
..
__tests__ 🌳 fix: Preserve Primary Files Until Secondary Cleanup Succeeds (#17228) 2026-10-23 07:00:20 +02:00
crud.js 📦 fix: Reuse Unchanged Code Snapshots and Batch the Uploads a Turn Still Needs (#18564) 2026-11-19 22:34:01 -05:00
crud.spec.js 📦 fix: Reuse Unchanged Code Snapshots and Batch the Uploads a Turn Still Needs (#18564) 2026-11-19 22:34:01 -05:00
index.js 🚧 chore: merge latest dev build (#4288) 2024-09-30 17:17:57 -04:00
preflight.js 🔇 fix: Stop logging an absent create_file target as an error (#15591) 2026-09-04 09:21:24 -04:00
preflight.spec.js 🔇 fix: Stop logging an absent create_file target as an error (#15591) 2026-09-04 09:21:24 -04:00
process.js 🪴 fix: Recognize Live Code Files Across API Layouts (#18165) 2026-11-14 14:00:26 -05:00
process.spec.js 🪴 fix: Recognize Live Code Files Across API Layouts (#18165) 2026-11-14 14:00:26 -05:00