fix: Model selector fuzzy search matches provider + id

Allows queries like 'anthropic opus' to match Anthropic models.
Previously only matched against model ID, so 'anthropic' token failed.
This commit is contained in:
Mario Zechner 2026-01-11 18:00:52 +01:00
parent 9655907624
commit 3592f9b7c9
2 changed files with 3 additions and 3 deletions

View file

@ -153,7 +153,7 @@ export class ModelSelectorComponent extends Container {
}
private filterModels(query: string): void {
this.filteredModels = fuzzyFilter(this.allModels, query, ({ id }) => id);
this.filteredModels = fuzzyFilter(this.allModels, query, ({ provider, id }) => `${provider} ${id}`);
this.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredModels.length - 1));
this.updateList();
}

View file

@ -268,8 +268,8 @@ export class InteractiveMode {
label: `${m.provider}/${m.id}`,
}));
// Fuzzy filter by model ID (not provider/id to avoid matching provider name)
const filtered = fuzzyFilter(items, prefix, (item) => item.id);
// Fuzzy filter by provider + model ID (allows "anthropic opus" to match)
const filtered = fuzzyFilter(items, prefix, (item) => `${item.provider} ${item.id}`);
if (filtered.length === 0) return null;