fix(ollama): use apiKey auth mode to avoid streamSimple crash

This commit is contained in:
Tibsfox 2026-04-05 11:06:38 -07:00
parent 092d1c0a9e
commit 352dd17e76

View file

@ -70,8 +70,13 @@ async function probeAndRegister(pi: ExtensionAPI): Promise<boolean> {
const baseUrl = getOllamaOpenAIBaseUrl();
// Use authMode "apiKey" with a dummy key (#3440).
// authMode "none" requires a custom streamSimple handler, but Ollama uses
// the standard OpenAI-compatible streaming endpoint. Ollama ignores the
// Authorization header so the dummy key is harmless.
pi.registerProvider("ollama", {
authMode: "none",
authMode: "apiKey",
apiKey: "ollama",
baseUrl,
api: "openai-completions",
isReady: () => true,