From: Pascal Date: Mon, 16 Mar 2026 11:04:06 +0000 (+0100) Subject: Fix model selector locked to first loaded model with multiple models (#20580) X-Git-Tag: upstream/0.0.8611~236 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=d65c4f2dc9e380317c2fed804b7d98a758ca0886;p=pkg%2Fggml%2Fsources%2Fllama.cpp Fix model selector locked to first loaded model with multiple models (#20580) * webui: fix model selector being locked to first loaded model When multiple models are loaded, the auto-select effect would re-fire on every loadedModelIds change, overriding the user's manual model selection. Guard with selectedModelId so auto-select only kicks in when no model is chosen yet. * chore: update webui build output --- diff --git a/tools/server/public/index.html.gz b/tools/server/public/index.html.gz index 98e2e4943..0da8083b5 100644 Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ diff --git a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte index 2ad830e18..b51dd682e 100644 --- a/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte +++ b/tools/server/webui/src/lib/components/app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte @@ -65,7 +65,8 @@ $effect(() => { if (conversationModel) { modelsStore.selectModelByName(conversationModel); - } else if (isRouter && modelsStore.loadedModelIds.length > 0) { + } else if (isRouter && !modelsStore.selectedModelId && modelsStore.loadedModelIds.length > 0) { + // auto-select the first loaded model only when nothing is selected yet const first = modelOptions().find((m) => modelsStore.loadedModelIds.includes(m.model)); if (first) modelsStore.selectModelById(first.id); }