From 84745e7cff33aa520bdde101b2897065b8c6f29a Mon Sep 17 00:00:00 2001 From: Pascal Date: Sun, 15 Mar 2026 08:04:23 +0100 Subject: [PATCH] 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. --- .../app/chat/ChatForm/ChatFormActions/ChatFormActions.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 2ad830e18f..b51dd682e0 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); }