LibreChat/api/server/services/Files
lia-by-librechat[bot] 94fed5bcd5
Some checks are pending
Backend Unit Tests / Build packages (push) Waiting to run
Backend Unit Tests / Codegraph select (push) Waiting to run
Backend Unit Tests / TypeScript type checks (push) Blocked by required conditions
Backend Unit Tests / Circular dependency checks (push) Waiting to run
Backend Unit Tests / Tests: api (shard 1/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 2/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: api (shard 3/3) (push) Blocked by required conditions
Backend Unit Tests / Tests: data-provider (push) Blocked by required conditions
Backend Unit Tests / Tests: data-schemas (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 1/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 2/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 3/4) (push) Blocked by required conditions
Backend Unit Tests / Tests: @librechat/api (shard 4/4) (push) Blocked by required conditions
Codegraph E2E Votes / vote (full suite) (push) Waiting to run
Docker Dev Branch Images Build / publish (push) Waiting to run
🥡 fix: Delete Storage and Embeddings With Owned Agent Files (#16007)
The agent tool-resource branch of DELETE /files removed a file's association
from the agent and answered 200 without reaching processDeleteRequest, so the
bytes on disk and the RAG chunks of a file the caller owned survived the delete.
A replaced File Search document kept answering from its old chunks (#15930).

An attached file now goes through the full delete pass, but only when nothing
else holds it: a file the caller does not own, and a file any other
(agent, tool_resource) pair still references, are unlinked and left whole.
Nothing is unlinked until the destroy it depends on has succeeded.

- packages/api/src/files/deletion.ts: deleteAgentResourceFiles owns the
  operation with its db methods and delete pass injected.
- packages/data-schemas: getSharedResourceFileIds answers the last-reference
  question, excluding the pair being removed by the agent's _id.
- Local/crud.js: unlinkFile propagates non-ENOENT, so a file whose bytes
  survive is no longer reported as deleted.

Co-authored-by: Mohammed Alshyakh <mohmedmm@users.noreply.github.com>
2026-09-17 02:59:25 +00:00
..
Audio 🚚 feat: Route Attachments and Provision Tools Lazily (#15763) 2026-09-08 23:28:52 -04:00
Azure 🔣 fix: Encode Images From Storage Keys (#15851) 2026-09-12 12:39:26 -04:00
Citations 🛤️ fix: Align File Search Citation Paths (#15650) 2026-09-06 17:25:47 -04:00
Code 🦘 feat: Share Run-Scoped Files With Subagents (#15848) 2026-09-12 20:14:22 -04:00
Firebase 🔣 fix: Encode Images From Storage Keys (#15851) 2026-09-12 12:39:26 -04:00
images 🔣 fix: Encode Images From Storage Keys (#15851) 2026-09-12 12:39:26 -04:00
Local 🥡 fix: Delete Storage and Embeddings With Owned Agent Files (#16007) 2026-09-17 02:59:25 +00: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: Delete Storage and Embeddings With Owned Agent Files (#16007) 2026-09-17 02:59:25 +00:00
process.spec.js 🥡 fix: Delete Storage and Embeddings With Owned Agent Files (#16007) 2026-09-17 02:59:25 +00: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