Summary
As of the 2026.4.x release, OpenClaw refuses to use the ollama API type for any provider that isn't the built-in Ollama URL. Custom provider entries in openclaw.json with "api": "ollama" now fail immediately with:
No API provider registered for api: ollama
This worked in prior releases (confirmed working as of 2026.3.24). We run a local proxy (toolbridge) that implements the native Ollama /api/chat wire format — api: "ollama" was the correct and natural configuration for it. That is now broken.
What api: "ollama" gave us
think: false injected at the native /api/chat level — the only place Ollama honours it for Qwen3.x models. The OpenAI-compat endpoint silently ignores it, causing multi-minute thinking loops.
options.num_ctx set automatically from contextWindow — no duplication in the Modelfile required.
- Proper Ollama streaming format, tool passing, etc.
The fallback paths are all broken too
Switching to openai-completions doesn't help. The injectNumCtxForOpenAICompat flag — the only other mechanism to get options.num_ctx injected — is gated behind isOllamaCompatProvider(), which hardcodes port 11434 or the literal provider id "ollama":
function isOllamaCompatProvider(model) {
if (providerId === "ollama") return true;
if (hostname === "localhost" && parsed.port === "11434") return true;
return providerHintsOllama && isOllamaPort && isOllamaCompatPath;
}
Any proxy on any other port, with any other name, is excluded. So:
api: "ollama" → rejected outright
api: "openai-completions" + injectNumCtxForOpenAICompat: true → silently does nothing
api: "openai-responses" → same; no num_ctx, no think suppression
The only remaining option is to bake PARAMETER num_ctx into the Modelfile — which defeats the point of having runtime-configurable context windows.
Requested fixes
-
Restore api: "ollama" support for arbitrary baseUrl providers. A proxy that implements /api/chat is Ollama-compatible regardless of what port it runs on. The operator has already opted in by setting api: "ollama".
-
If keeping the restriction, make injectNumCtxForOpenAICompat: true act as an explicit override for isOllamaCompatProvider(). If the operator has set that flag, they know what they're doing.
-
Document the change. This appears to be a silent regression in the 2026.4.x window with no mention in the changelog.
Environment
lastTouchedVersion: 2026.4.5
lastRunVersion (wizard): 2026.3.24
- Platform: Linux/WSL2
- Local proxy: toolbridge (Python aiohttp, implements
/api/chat and /v1/chat/completions)
Summary
As of the 2026.4.x release, OpenClaw refuses to use the
ollamaAPI type for any provider that isn't the built-in Ollama URL. Custom provider entries inopenclaw.jsonwith"api": "ollama"now fail immediately with:This worked in prior releases (confirmed working as of 2026.3.24). We run a local proxy (toolbridge) that implements the native Ollama
/api/chatwire format —api: "ollama"was the correct and natural configuration for it. That is now broken.What
api: "ollama"gave usthink: falseinjected at the native/api/chatlevel — the only place Ollama honours it for Qwen3.x models. The OpenAI-compat endpoint silently ignores it, causing multi-minute thinking loops.options.num_ctxset automatically fromcontextWindow— no duplication in the Modelfile required.The fallback paths are all broken too
Switching to
openai-completionsdoesn't help. TheinjectNumCtxForOpenAICompatflag — the only other mechanism to getoptions.num_ctxinjected — is gated behindisOllamaCompatProvider(), which hardcodes port11434or the literal provider id"ollama":Any proxy on any other port, with any other name, is excluded. So:
api: "ollama"→ rejected outrightapi: "openai-completions"+injectNumCtxForOpenAICompat: true→ silently does nothingapi: "openai-responses"→ same; nonum_ctx, no think suppressionThe only remaining option is to bake
PARAMETER num_ctxinto the Modelfile — which defeats the point of having runtime-configurable context windows.Requested fixes
Restore
api: "ollama"support for arbitrarybaseUrlproviders. A proxy that implements/api/chatis Ollama-compatible regardless of what port it runs on. The operator has already opted in by settingapi: "ollama".If keeping the restriction, make
injectNumCtxForOpenAICompat: trueact as an explicit override forisOllamaCompatProvider(). If the operator has set that flag, they know what they're doing.Document the change. This appears to be a silent regression in the 2026.4.x window with no mention in the changelog.
Environment
lastTouchedVersion: 2026.4.5lastRunVersion(wizard): 2026.3.24/api/chatand/v1/chat/completions)