fix: UI single model selection in router mode (#19767)

This commit is contained in:
crsawyer
2026-02-21 09:28:39 +01:00
committed by GitHub
parent ba3b9c8844
commit 07968d53e4
3 changed files with 10 additions and 3 deletions
@@ -306,6 +306,16 @@ class ModelsStore {
const response = await ModelsService.listRouter();
this.routerModels = response.data;
await this.fetchModalitiesForLoadedModels();
const o = this.models.filter((option) => {
const modelProps = this.getModelProps(option.model);
return modelProps?.webui !== false;
});
if (o.length === 1 && this.isModelLoaded(o[0].model)) {
this.selectModelById(o[0].id);
}
} catch (error) {
console.warn('Failed to fetch router models:', error);
this.routerModels = [];