From c23341e4c8a9e738113b398e07314189781772b5 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Mon, 6 Oct 2025 18:39:13 -0400 Subject: [PATCH] tui: prioritize opencode provider in model selection so users see their default provider first instead of hunting through alphabetically sorted list --- .../opencode/src/cli/cmd/tui/component/dialog-model.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx index 32e00882b..5a42e3873 100644 --- a/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx +++ b/packages/opencode/src/cli/cmd/tui/component/dialog-model.tsx @@ -1,7 +1,7 @@ import { createMemo } from "solid-js" import { useLocal } from "@tui/context/local" import { useSync } from "@tui/context/sync" -import { map, pipe, flatMap, entries, filter, isDeepEqual } from "remeda" +import { map, pipe, flatMap, entries, filter, isDeepEqual, sortBy } from "remeda" import { DialogSelect } from "@tui/ui/dialog-select" import { useDialog } from "@tui/ui/dialog" @@ -27,6 +27,10 @@ export function DialogModel() { }), ...pipe( sync.data.provider, + sortBy( + (provider) => provider.id !== "opencode", + (provider) => provider.name, + ), flatMap((provider) => pipe( provider.models,