From e508d925b194566cccc0165fbe99616324b5ac61 Mon Sep 17 00:00:00 2001 From: nesnewsnad Date: Wed, 28 Jan 2026 11:23:04 -0500 Subject: [PATCH] fix(ollama): add missing api field to auto-discovered models Auto-discovered Ollama models from discoverOllamaModels() were missing the `api` field, causing "Unhandled API in mapOptionsForApi: undefined" errors when the model was used at runtime. This adds `api: "openai-completions"` to match the provider-level configuration in buildOllamaProvider(). Fixes #3153 --- src/agents/models-config.providers.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/agents/models-config.providers.ts b/src/agents/models-config.providers.ts index a176dac8a..1c4b4cd72 100644 --- a/src/agents/models-config.providers.ts +++ b/src/agents/models-config.providers.ts @@ -120,6 +120,7 @@ async function discoverOllamaModels(): Promise { cost: OLLAMA_DEFAULT_COST, contextWindow: OLLAMA_DEFAULT_CONTEXT_WINDOW, maxTokens: OLLAMA_DEFAULT_MAX_TOKENS, + api: "openai-completions", }; }); } catch (error) {