diff --git a/src/servers/api/chat/list-models.ts b/src/servers/api/chat/list-models.ts index c742d56d..1cb8172e 100644 --- a/src/servers/api/chat/list-models.ts +++ b/src/servers/api/chat/list-models.ts @@ -11,6 +11,9 @@ const CLAUDE_CODE_MODELS: ModelInfo[] = [ const OPENCODE_BIN = process.env.OPENCODE_BIN || join(homedir(), '.opencode', 'bin', 'opencode'); +// Curated OpenCode models to surface in the picker (the full `opencode models` catalog is ~58 entries). +const OPENCODE_ALLOWLIST = new Set(['opencode/big-pickle', 'opencode/claude-haiku-4-5']); + // Cache the OpenCode catalog; it's stable for a session and `opencode models` costs a subprocess. let openCodeCache: ModelInfo[] | null = null; @@ -33,7 +36,7 @@ async function listOpenCodeModels(): Promise { .replace(/\x1b\[[0-9;]*m/g, '') .split('\n') .map((line) => line.trim()) - .filter((line) => line.includes('/')) + .filter((line) => OPENCODE_ALLOWLIST.has(line)) .map((full) => { const slash = full.indexOf('/'); return {