The open source coding agent.
TypeScript
fix: search all recent models instead of only top 5 in TUI /models command
Aiden Clinede28fafb471c
diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsxindex fc0559cd686..bc90dbb5c6e 100644--- a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx+++ b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx@@ -37,11 +37,9 @@ export function DialogModel(props: { providerID?: string }) {const recents = local.model.recent()const recentList = showExtra()- ? recents- .filter(- (item) => !favorites.some((fav) => fav.providerID === item.providerID && fav.modelID === item.modelID),- )- .slice(0, 5)+ ? recents.filter(+ (item) => !favorites.some((fav) => fav.providerID === item.providerID && fav.modelID === item.modelID),+ ): []const favoriteOptions = favorites.flatMap((item) => {@@ -182,7 +180,10 @@ export function DialogModel(props: { providerID?: string }) {// Apply fuzzy filtering to each section separately, maintaining section orderif (q) {const filteredFavorites = fuzzysort.go(q, favoriteOptions, { keys: ["title"] }).map((x) => x.obj)- const filteredRecents = fuzzysort.go(q, recentOptions, { keys: ["title"] }).map((x) => x.obj)+ const filteredRecents = fuzzysort+ .go(q, recentOptions, { keys: ["title"] })+ .map((x) => x.obj)+ .slice(0, 5)const filteredProviders = fuzzysort.go(q, providerOptions, { keys: ["title", "category"] }).map((x) => x.obj)const filteredPopular = fuzzysort.go(q, popularProviders, { keys: ["title"] }).map((x) => x.obj)return [...filteredFavorites, ...filteredRecents, ...filteredProviders, ...filteredPopular]