LibreChat/api/server/services/Endpoints/agents
Danny Avila 29971f188a
🧺 fix: Skip Priming Denied File Search Resources (#15699)
#15691 paired every read of `AgentCapabilities.execute_code` / `file_search`
with its role grant, and skipped `execute_code` from the resend-file priming
when `RUN_CODE` was denied. It left the `file_search` half: the grant was not
available inside `initializeAgent`, so a role denied `FILE_SEARCH` still had
its prior-turn search files re-hydrated on every resend.

Priming is not free. The files are fetched, `updateFilesUsage` bumps their
counters, and `primeResources` builds `tool_resources.file_search` — all for
a tool the loader is about to drop. A deployment with the capability off paid
the same cost.

`InitializeAgentParams.fileSearchAvailable` carries the capability AND the
grant, resolved from the same single `resolveToolRoleGrants` read that already
answers `codeEnvAvailable`, so pairing the second flag costs no extra role
lookup. Every initializer that resolves grants forwards it: the chat path and
its handoff, added-convo and discovery hand-offs, both API routes, and the
OpenAI-compatible embedder route. Absent leaves priming unconditional, so an
embedder that resolves no grant keeps its current behavior.

The loop that selected the resend tool resources becomes
`resolveResendToolResources`, which makes both halves of the gate testable
rather than reachable only through a full agent initialization.

The memory agent is untouched: it passes no `conversationId`, so it never
reaches this priming.

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-07 07:56:23 -04:00
..
addedConvo.js 🧺 fix: Skip Priming Denied File Search Resources (#15699) 2026-09-07 07:56:23 -04:00
addedConvo.spec.js 🧺 fix: Skip Priming Denied File Search Resources (#15699) 2026-09-07 07:56:23 -04:00
backgroundCompletion.js 🛎️ feat: Wake Agents on Background Tool Completion (#15350) 2026-08-30 08:56:41 -04:00
build.js 🚧 fix: Narrow Chat MCP Selections to What the Picker May Offer (#15478) 2026-09-01 18:47:36 -04:00
eventChildLease.js 📨 feat: Continue Bound Child Agents from Events (#15112) 2026-08-23 01:15:57 -04:00
index.js
initialize.js 🧺 fix: Skip Priming Denied File Search Resources (#15699) 2026-09-07 07:56:23 -04:00
initialize.spec.js 🌳 feat: List Attached Workspace Trees (#15527) 2026-09-04 10:52:34 -04:00
skillDeps.js 📓 feat: Author Files in Attached Workspaces (#15548) 2026-09-04 12:16:23 -04:00
skillDeps.spec.js 📓 feat: Author Files in Attached Workspaces (#15548) 2026-09-04 12:16:23 -04:00
subagentThreadStore.js 💓 fix: Detect Silently Dead Redis Sockets With Deadline-Bounded Heartbeats (#15539) 2026-09-03 09:45:16 -04:00
subagentThreadStore.spec.js 💓 fix: Detect Silently Dead Redis Sockets With Deadline-Bounded Heartbeats (#15539) 2026-09-03 09:45:16 -04:00
title.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00
title.test.js 🛂 feat: Filter Model-Bound Content by Source (#14425) 2026-08-21 22:43:32 -04:00