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
This commit is contained in:
Classic298 2026-10-28 02:19:19 +01:00 • committed by GitHub
parent e3ad014fb2
commit 3febf25d84
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<string, any> | null = null;
let settingDefaults: Promise<void> | null = null;
$: if (!loading && modelDefaults && !equal(selectedModelIds, defaultsModelIds)) {
setDefaults(true);
}
const setDefaults = async (preserveSelections = false) => {
const modelIds = atSelectedModel ? [atSelectedModel.id] : [...selectedModels];
const id = $chatId;