mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-17 05:20:55 +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__ | ||
| callbacks.background.spec.js | ||
| callbacks.js | ||
| client.imageDetail.spec.js | ||
| client.js | ||
| client.test.js | ||
| errors.js | ||
| filterAuthorizedTools.spec.js | ||
| openai.js | ||
| protocol.js | ||
| queuedTurns.js | ||
| recordCollectedUsage.spec.js | ||
| request.js | ||
| responses.js | ||
| resume.js | ||
| steer.js | ||
| v1.js | ||
| v1.spec.js | ||