From 3febf25d845a9f310d1b53fcfac3fcbf5d28a3fb Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Wed, 28 Oct 2026 02:19:19 +0100 Subject: [PATCH] fix: message ignores the Web Search toggle after switching models (#33275) After changing the model or adding a second one to compare, the Web Search toggle showed the new default but the next message still went out with the previous model's setting. A model without Web Search as a default feature could search, and one with it did not. The message now follows what the toggle shows. Fixes #33265 --- src/lib/components/chat/Chat.svelte | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index a1608ff27a..9f21f61616 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -368,6 +368,11 @@ let pendingWebSearchPrompt: string | null = null; let webSearchConfirmed = false; + // Before webSearchActive, so it sees the new defaults in the same update + $: if (!loading && modelDefaults && !equal(selectedModelIds, defaultsModelIds)) { + setDefaults(true); + } + $: { const currentModels = atSelectedModel?.id ? [atSelectedModel.id] : selectedModels; const allModelsSupportWebSearch = @@ -1103,10 +1108,6 @@ let modelDefaults: Record | null = null; let settingDefaults: Promise | null = null; - $: if (!loading && modelDefaults && !equal(selectedModelIds, defaultsModelIds)) { - setDefaults(true); - } - const setDefaults = async (preserveSelections = false) => { const modelIds = atSelectedModel ? [atSelectedModel.id] : [...selectedModels]; const id = $chatId;