New conversations now auto-select the first loaded model (#20403)

* webui: auto-select first loaded model for new conversations in router mode

* chore: update webui build output
This commit is contained in:
Pascal 2026-03-12 09:07:05 +01:00 committed by GitHub
parent 05039967da
commit de190154c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 8 deletions

Binary file not shown.

View File

@ -62,15 +62,12 @@
chatStore.getConversationModel(activeMessages() as DatabaseMessage[]) chatStore.getConversationModel(activeMessages() as DatabaseMessage[])
); );
let previousConversationModel: string | null = null;
$effect(() => { $effect(() => {
if (conversationModel && conversationModel !== previousConversationModel) { if (conversationModel) {
previousConversationModel = conversationModel; modelsStore.selectModelByName(conversationModel);
} else if (isRouter && modelsStore.loadedModelIds.length > 0) {
if (!isRouter || modelsStore.isModelLoaded(conversationModel)) { const first = modelOptions().find((m) => modelsStore.loadedModelIds.includes(m.model));
modelsStore.selectModelByName(conversationModel); if (first) modelsStore.selectModelById(first.id);
}
} }
}); });