diff --git a/src/agents/model-auth.ts b/src/agents/model-auth.ts index 680d0f53c..238e6395d 100644 --- a/src/agents/model-auth.ts +++ b/src/agents/model-auth.ts @@ -275,6 +275,7 @@ export function resolveEnvApiKey(provider: string): EnvApiKeyResult | null { groq: "GROQ_API_KEY", deepgram: "DEEPGRAM_API_KEY", cerebras: "CEREBRAS_API_KEY", + ollama: "OLLAMA_API_KEY", xai: "XAI_API_KEY", openrouter: "OPENROUTER_API_KEY", "vercel-ai-gateway": "AI_GATEWAY_API_KEY", diff --git a/src/commands/model-picker.ts b/src/commands/model-picker.ts index 5cceb1e94..d2179c797 100644 --- a/src/commands/model-picker.ts +++ b/src/commands/model-picker.ts @@ -145,6 +145,14 @@ export async function promptDefaultModel( ); const hasPreferredProvider = preferredProvider ? providers.includes(preferredProvider) : false; + + // If preferredProvider is specified but not in catalog, skip the picker. + // This handles auto-discovering providers (e.g., Ollama) where models aren't + // in the static catalog but were already configured by the auth handler. + if (preferredProvider && !hasPreferredProvider) { + return {}; + } + const shouldPromptProvider = !hasPreferredProvider && providers.length > 1 && models.length > PROVIDER_FILTER_THRESHOLD; if (shouldPromptProvider) { diff --git a/src/commands/models/list.status-command.ts b/src/commands/models/list.status-command.ts index 8aa7015c8..1c2d2e78a 100644 --- a/src/commands/models/list.status-command.ts +++ b/src/commands/models/list.status-command.ts @@ -131,6 +131,7 @@ export async function modelsStatusCommand( "cerebras", "xai", "openrouter", + "ollama", "zai", "mistral", "synthetic",