From 3f10b7f91a193e246a92fa987661abc44a77efc9 Mon Sep 17 00:00:00 2001 From: AlexRV12 <71396855+AlexRV12@users.noreply.github.com> Date: Wed, 19 Aug 2026 15:35:32 +0200 Subject: [PATCH] docs: record why the session tool filter runs unconditionally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The filter would strip everything from a non-GLOBAL toolset, whose names carry no policy entries. That cannot happen — `changeMode` refuses to move a session chat out of GLOBAL, and `sessionAccess` is only ever set for session chats — but the dependency was not visible at the filter itself. --- .../src/lib/components/copilot/chat/AIChatManager.svelte.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts index 9747e57a4e..07dcb0b47c 100644 --- a/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts +++ b/frontend/src/lib/components/copilot/chat/AIChatManager.svelte.ts @@ -2691,7 +2691,10 @@ export class AIChatManager { // The one place every tool source converges, which is why the capability // filter belongs here and not in `globalToolsFor`. This same array both // advertises the tools and dispatches the calls, so a withheld tool is - // unreachable rather than merely unlisted. + // unreachable rather than merely unlisted. Filtering is unconditional + // because `sessionAccess` is set only for session chats and `changeMode` + // keeps those GLOBAL — a non-GLOBAL toolset has no policy entries and + // would fail closed to nothing. get tools() { return filterSessionTools([...self.tools, ...self.planMode.tools], self.sessionAccess) },