mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 21:08:17 +00:00
Four review rounds found thirteen issues, all one class: a boundary the permission check had not been copied into. Rounds 2 and 3 each found gaps created by the previous round's fix, and a manual sweep of tool constructors and upload routes still missed the `codeEnvAvailable` family entirely — because the thing worth enumerating is not "paths that reach a tool" but "reads of the capability". There are 28 such reads. This replaces per-site permission checks with one resolution per request, pairs every read that is a gate, and pins the list so a new one cannot be added silently. - `resolveToolRoleGrants` resolves `RUN_CODE` and `FILE_SEARCH` together and memoizes on the request. Both perf findings disappear by construction: gates share one role read instead of each issuing its own. - Newly paired gates: `codeEnvAvailable` in the OpenAI-compatible, Responses and memory-agent initializers (`initializeAgent` rebuilds `bash_tool`, `read_file` and the workspace file tools from it, and hands their handlers the code environment); the capability checks in agent upload processing and in agent-management upload purposes; and the library chat-completion service, behind an optional `getRoleByName` dependency so embedders are not broken. - The v1 Knowledge upload posts `assistant_id` with no `tool_resource`, so there is no resource to authorize. It now reads the assistant's own native tools and requires their grants, instead of treating a missing resource as unrestricted. - The startup role read moved off the critical path into the existing `Promise.all`, and the direct tool-call check passes `req` so the shared loader gate reuses its result rather than repeating the lookup. - `toolCapabilityGates.spec.js` pins every file that reads either capability with a count and a reason. A new read fails the suite until it is classified, so the next boundary announces itself instead of waiting for a reviewer. |
||
|---|---|---|
| .. | ||
| __tests__ | ||
| agents | ||
| assistants | ||
| auth | ||
| AuthController.js | ||
| AuthController.spec.js | ||
| avatar.contentFilter.spec.js | ||
| Balance.js | ||
| Balance.spec.js | ||
| EndpointController.js | ||
| FavoritesController.js | ||
| FavoritesController.spec.js | ||
| mcp.js | ||
| ModelController.js | ||
| ModelController.spec.js | ||
| PermissionsController.js | ||
| PluginController.js | ||
| PluginController.spec.js | ||
| SkillStatesController.js | ||
| TokenConfigController.js | ||
| tools.js | ||
| TwoFactorController.js | ||
| UserController.js | ||
| UserController.spec.js | ||