From 4c2f73b6489a6d23b168f01b68663cdad821f786 Mon Sep 17 00:00:00 2001 From: "Naveen R. Iyer" Date: Mon, 13 Jul 2026 11:18:56 -0500 Subject: [PATCH] fix: apply model-attached tools in multi-model chats In multi-model (compare) chats, tools attached to a model were not applied because the per-model request builder derived tool IDs only from the composer's selected tools, which are not reliably populated per model in that mode. Union each model's own attached tool IDs (limited to installed tools) into its request payload so model tools apply regardless of the composer selection state. Signed-off-by: Naveen R. Iyer --- src/lib/components/chat/Chat.svelte | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index 85308451b7..4612d9ec79 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -2528,7 +2528,12 @@ const toolIds = []; const toolServerIds = []; - for (const toolId of selectedToolIds) { + // Include this model's own attached tools so they apply in multi-model chats, + // independent of the composer's selectedToolIds lifecycle. + const modelDefaultToolIds = (model?.info?.meta?.toolIds ?? []).filter((id) => + $tools.find((t) => t.id === id) + ); + for (const toolId of [...new Set([...selectedToolIds, ...modelDefaultToolIds])]) { if (toolId.startsWith('direct_server:')) { let serverId = toolId.replace('direct_server:', ''); // Check if serverId is a number