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;