Summary
OpenClaw gateway on macOS/launchd still fails to register the Ollama provider at runtime even after:
- removing
models.providers.ollama from ~/.openclaw/openclaw.json
- setting
OLLAMA_API_KEY=ollama-local
- restarting the gateway cleanly
Startup logs show the session/agent model as ollama/qwen3.5:4b, but live requests still fail with Unknown model: ollama/qwen3.5:4b and silently fall back to openai-codex/gpt-5.4.
Environment
- OpenClaw:
2026.3.31
- OS: macOS (LaunchAgent / launchd)
- Gateway label:
ai.openclaw.gateway
- Ollama local API working directly outside gateway
- Local test model:
ollama/qwen3.5:4b
Expected behavior
If:
models.providers.ollama is absent (implicit behavior)
- LaunchAgent env contains
OLLAMA_API_KEY=ollama-local
- gateway is restarted
then ollama/qwen3.5:4b should register and serve requests without fallback.
Actual behavior
Gateway startup shows Ollama as the configured model:
[lcm] Compaction summarization model: ollama/qwen3.5:4b (default)
agent model: ollama/qwen3.5:4b
But live requests fail immediately:
FailoverError: Unknown model: ollama/qwen3.5:4b. Ollama requires authentication to be registered as a provider. Set OLLAMA_API_KEY="ollama-local" (any value works) or run "openclaw configure".
and then:
Model "ollama/qwen3.5:4b" not found. Fell back to "openai-codex/gpt-5.4".
Repro steps
- Ensure local Ollama is running and the model is available directly.
- Remove
models.providers.ollama from ~/.openclaw/openclaw.json.
- Set LaunchAgent env:
OLLAMA_API_KEY=ollama-local
- Restart gateway.
- Request
ollama/qwen3.5:4b in a live session.
- Inspect gateway log.
Evidence
Config state
models.providers no longer contains ollama
- active provider keys in config:
anthropic, google, minimax-portal
LaunchAgent env
Persisted plist env now contains:
"OLLAMA_API_KEY" => "ollama-local"
Fresh startup log
2026-04-05T01:51:47 [lcm] Compaction summarization model: ollama/qwen3.5:4b (default)
2026-04-05T01:51:48 agent model: ollama/qwen3.5:4b
Fresh failure log after restart
2026-04-05T01:52:27 lane task error: lane=main durationMs=858 error="FailoverError: Unknown model: ollama/qwen3.5:4b. Ollama requires authentication to be registered as a provider. Set OLLAMA_API_KEY=\"ollama-local\" (any value works) or run \"openclaw configure\". See: https://docs.openclaw.ai/providers/ollama"
2026-04-05T01:52:27 model_fallback_decision: candidate_failed requestedProvider=ollama requestedModel=qwen3.5:4b reason=model_not_found nextCandidateProvider=openai-codex nextCandidateModel=gpt-5.4
2026-04-05T01:52:31 Model "ollama/qwen3.5:4b" not found. Fell back to "openai-codex/gpt-5.4".
Notes
This may be one of:
- LaunchAgent env not being used by Ollama provider registration path
- wrong env key being checked by provider bootstrap
- implicit Ollama provider registration not occurring in gateway runtime on macOS launchd
- session/agent startup path believing the model exists before provider registration actually succeeds
Impact
This is confusing because session_status / startup logs can imply Ollama is active, while actual serving silently falls back to a cloud model.
Summary
OpenClaw gateway on macOS/launchd still fails to register the Ollama provider at runtime even after:
models.providers.ollamafrom~/.openclaw/openclaw.jsonOLLAMA_API_KEY=ollama-localStartup logs show the session/agent model as
ollama/qwen3.5:4b, but live requests still fail withUnknown model: ollama/qwen3.5:4band silently fall back toopenai-codex/gpt-5.4.Environment
2026.3.31ai.openclaw.gatewayollama/qwen3.5:4bExpected behavior
If:
models.providers.ollamais absent (implicit behavior)OLLAMA_API_KEY=ollama-localthen
ollama/qwen3.5:4bshould register and serve requests without fallback.Actual behavior
Gateway startup shows Ollama as the configured model:
But live requests fail immediately:
and then:
Repro steps
models.providers.ollamafrom~/.openclaw/openclaw.json.OLLAMA_API_KEY=ollama-localollama/qwen3.5:4bin a live session.Evidence
Config state
models.providersno longer containsollamaanthropic,google,minimax-portalLaunchAgent env
Persisted plist env now contains:
Fresh startup log
Fresh failure log after restart
Notes
This may be one of:
Impact
This is confusing because
session_status/ startup logs can imply Ollama is active, while actual serving silently falls back to a cloud model.