mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-16 13:00:55 +00:00
* feat: Remember Tool Approvals Per Conversation Adds an opt-in "Always allow" choice to the tool approval card. When endpoints.agents.toolApproval.allowAlways is true, the server marks eligible paused calls with allow_always; approving with scope "session" stores that exact tool name on the conversation, and later runs in the same conversation fold the stored names into the policy as exact-name allow entries. The server enforces every step: the resume route rejects a session scope the pause did not offer, eligibility is rechecked against the live policy before storing, the list is written only through an owner-scoped bounded method, and generic saves and imports cannot set or clear it. Admin deny and ask rules and programmatic hooks still win, stored names are ignored under dontAsk or when the flag is off, and native code tools stay under the code approval picker. The flag defaults to false, so existing deployments keep prompting. * fix: Share the Effective Approval Policy and Persist Allows After Resume Fences Offering, resume re-check, scheduled admission and createRun now read one policy from buildEffectiveToolApprovalPolicy: endpoint rules healed against MCP alias spellings, then the conversation's remembered tools. A call held by a healed ask rule is no longer offered "Always allow", and a scheduled fire whose known tools are all remembered is no longer rejected as pause capable. The remembered-tools cap and name length cap move to toolApproval.allowAlwaysMaxTools and allowAlwaysMaxToolNameLength (defaults 64 and 256). The card stops offering the choice for new tools once the cap is reached instead of silently approving once. The resume route stores remembered tools only after the schedule and project context fences pass; a storage failure still approves the call once. * fix: Offer Always Allow Only When It Will Hold Offer allow_always only when storing the name would auto-approve the next identical call on the run's own path: every MCP spelling of the tool passes the healed static policy and no programmatic or plugin approval hook can apply to it (the pause payload does not record which hook asked). Remembered names now expand to every alias spelling of the same tool, and a deny or ask on any spelling keeps the tool ineligible. A table-driven spec walks the invariant through the real hook wiring. * fix: Recheck Approval Hooks Before Remembering a Resumed Approval The resume-time eligibility recheck now applies the same programmatic and plugin PreToolUse hook check as marking, with a hook context built from the resume request and the live plugin hook source. A hook registered after the pause turns the choice into a one-time approval: nothing is stored and the resume continues. Document that toolApproval.allowAlways should be enabled only once every replica supports it, since older replicas ignore the choice. * fix: Judge Always Allow Offers Against the Run's Live Aliases and Active Cap * fix: Charge Only New Tool Names Against the Remembered Approval Cap * fix: Recheck Remembered Approvals Against the Paused Run's Aliases * chore: Sort Imports in Agent Run After Rebase |
||
|---|---|---|
| .. | ||
| controllers | ||
| middleware | ||
| routes | ||
| services | ||
| utils | ||
| cleanup.js | ||
| csp.spec.js | ||
| experimental.js | ||
| experimental.spec.js | ||
| index.js | ||
| index.metrics.spec.js | ||
| index.spec.js | ||
| socialLogins.js | ||
| socialLogins.spec.js | ||
| telemetry.js | ||
| telemetry.spec.js | ||