LibreChat/api/server/services
Danny Avila 9044dedcb2 🧰 fix: Move upload destination policy into shared code and share one size accounting
Destination and acceptability were decided by a block of new policy in the legacy
file service: promote a text-routed upload to context, find a tool that could
consume one kept off the model path, refuse one that nothing could read or that
would land on no agent resource. That is backend policy rather than wiring, and
the workspace rules put it elsewhere.

It now lives in data-provider as one pure function, next to the delivery-path
resolution it follows. That is also the only home reachable from here: the file
service cannot import from packages/api, because a suite mocks that package with
an explicit allowlist and any real import becomes undefined under test. The rules
are provider-agnostic policy either way, so this is where they belong rather than
merely where they fit.

The earlier deduplication of the shared size allowance covered the deferred
filter and not the persistent screening, which recomputed the budget from both
raw arrays and could silently drop a persistent file that fits. Both now use one
accounting that counts a file appearing in several sets once.
2026-08-31 21:31:24 -04:00
..
__tests__
Agents
Artifacts
Config
Endpoints 🐛 fix: Hydrate deferred attachments for later tool calls 2026-08-31 14:22:50 -04:00
Files 🧰 fix: Move upload destination policy into shared code and share one size accounting 2026-08-31 21:31:24 -04:00
Runs
Schedules
Skills
start
Threads
Tools
ActionService.js
ActionService.spec.js
AssistantService.js
AuthService.js
AuthService.spec.js
cleanup.js
createRunBody.js
createRunBody.spec.js
GraphApiService.js
GraphApiService.spec.js
GraphTokenService.js
initializeMCPs.js
initializeMCPs.plugins.spec.js
initializeMCPs.spec.js
initializeOAuthReconnectManager.js
MCP.js
MCP.spec.js
MCPRequestContext.js
OboPolicyService.js
OboTokenService.js
OboTokenService.spec.js
OpenIDRefreshFlight.js
OpenIDRefreshFlight.spec.js
OpenIDRefreshRecovery.js
OpenIDSessionRefresh.js
OpenIDSessionRefresh.spec.js
PermissionService.js
PermissionService.spec.js
PluginService.js
PluginService.spec.js
RefreshTokenBridge.js
RefreshTokenBridge.spec.js
systemGrant.spec.js
ToolService.js
twoFactorService.js
twoFactorService.spec.js