openclaw - ✅(Solved) Fix [Bug]: Model "Not Found" (404) errors when using a remote Ollama provider as a fallback [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#62533Fetched 2026-04-08 03:02:54
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Participants
Timeline (top)
labeled ×2referenced ×2cross-referenced ×1

Model "Not Found" (404) errors when using a remote Ollama provider, even though the model exists on the server and is reachable via curl - For a multiple ollama provider setup. Apparent root cause: the resolveOllamaBaseUrlForRun function in the Ollama provider appears to be defaulting to OLLAMA_NATIVE_BASE_URL (127.0.0.1:11434) because it's not correctly receiving or identifying the providerBaseUrl during the run. Feel free to let me know should you need more specific information about my configuration!

Error Message

Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.595+07:00 [agent] embedded run failover decision: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 stage=assistant decision=fallback_model reason=model_not_found provider=ollama-lan/qwen3.5-32k:latest profile=- Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.597+07:00 [diagnostic] lane task error: lane=subagent durationMs=6248 error="FailoverError: 404 {"error":"model 'qwen3.5-32k:latest' not found"}" Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.598+07:00 [diagnostic] lane task error: lane=session:agent:main:subagent:e76b397e-4515-4121-af83-5e9c86ec7f25 durationMs=6249 error="FailoverError: 404 {"error":"model 'qwen3.5-32k:latest' not found"}" Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.600+07:00 [model-fallback] model fallback decision: decision=candidate_failed requested=ollama-lan/qwen3.5-32k:latest candidate=ollama-lan/qwen3.5-32k:latest reason=model_not_found next=ollama-lan/qwen3.5-16k:latest Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.124+07:00 [agent] low context window: ollama-lan/qwen3.5-16k:latest ctx=16384 (warn<32000) source=modelsConfig Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.167+07:00 [skills] Skipping skill path that resolves outside its configured root. Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.559+07:00 [agent] embedded run agent end: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 isError=true model=qwen3.5-16k:latest provider=ollama-lan error=404 {"error":"model 'qwen3.5-16k:latest' not found"} rawError=404 {"error":"model 'qwen3.5-16k:latest' not found"} Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.571+07:00 [agent] embedded run failover decision: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 stage=assistant decision=fallback_model reason=model_not_found provider=ollama-lan/qwen3.5-16k:latest profile=- Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.573+07:00 [diagnostic] lane task error: lane=subagent durationMs=2971 error="FailoverError: 404 {"error":"model 'qwen3.5-16k:latest' not found"}" Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.573+07:00 [diagnostic] lane task error: lane=session:agent:main:subagent:e76b397e-4515-4121-af83-5e9c86ec7f25 durationMs=2972 error="FailoverError: 404 {"error":"model 'qwen3.5-16k:latest' not found"}" Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.575+07:00 [model-fallback] model fallback decision: decision=candidate_failed requested=ollama-lan/qwen3.5-32k:latest candidate=ollama-lan/qwen3.5-16k:latest reason=model_not_found next=none Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.577+07:00 [ws] ⇄ res ✗ agent errorCode=UNAVAILABLE errorMessage=FallbackSummaryError: All models failed (2): ollama-lan/qwen3.5-32k:latest: 404 {"error":"model 'qwen3.5-32k:latest' not found"} (model_not_found) | ollama-lan/qwen3.5-16k:latest: 404 {"error":"model 'qwen3.5-16k:latest' not found"} (model_... runId=e06359f9-8117-4e53-ae66-c2f2b566c006 error=FallbackSummaryError: All models failed (2): ollama-lan/qwen3.5-32k:latest: 404 {"error":"model 'qwen3.5-32k:latest' not found"} (model_not_found) | ollama-lan/qwen3.5-16k:latest: 404 {"error":"model 'qwen3.5-16k:latest' not found"} (model_... conn=bce09c9c…606e id=e59a3ad9…7a47

Root Cause

Model "Not Found" (404) errors when using a remote Ollama provider, even though the model exists on the server and is reachable via curl - For a multiple ollama provider setup. Apparent root cause: the resolveOllamaBaseUrlForRun function in the Ollama provider appears to be defaulting to OLLAMA_NATIVE_BASE_URL (127.0.0.1:11434) because it's not correctly receiving or identifying the providerBaseUrl during the run. Feel free to let me know should you need more specific information about my configuration!

Fix Action

Fixed

PR fix notes

PR #62549: fix(ollama): accept baseURL alias so remote Ollama hosts are not ignored

Description (problem / solution / changelog)

Summary

  • Add readProviderBaseUrl() helper that accepts both baseUrl (canonical lowercase) and baseURL (OpenAI SDK convention uppercase)
  • Update all Ollama provider code paths to use the helper for consistent URL resolution
  • Add comprehensive test coverage (12 tests) for both spellings, whitespace handling, and edge cases

Problem

Users familiar with the OpenAI SDK convention often write baseURL (uppercase URL) in their openclaw.json:

{
  "models": {
    "providers": {
      "ollama-lan": {
        "baseURL": "http://192.168.1.100:11434"  // ← OpenAI SDK style
      }
    }
  }
}

But OpenClaw's config schema expects baseUrl (lowercase). This caused remote Ollama hosts to be silently ignored, with requests falling back to localhost:11434 and resulting in:

404 {"error":"model 'qwen3.5-32k:latest' not found"}

Solution

Created readProviderBaseUrl() helper that:

  1. Checks baseUrl (canonical spelling) first
  2. Falls back to baseURL (alternate spelling) if not found
  3. Returns trimmed URL string or undefined

Updated all Ollama provider paths:

  • Provider catalog discovery
  • buildOllamaProvider() call
  • createConfiguredOllamaStreamFn() baseUrl resolution
  • ensureOllamaModelPulled() baseUrl lookup
  • hasMeaningfulExplicitOllamaConfig() check

Test Coverage

CategoryTests
Canonical baseUrl6
Alternate baseURL4
Edge cases2
Total12

All tests pass locally.

Issue

Fixes #62533

Related

  • #54754 - Original bug report
  • #57214 - Previous fix attempt (CI failures, unmerged)
  • #61755 - Multi-provider routing fix

Checklist

  • Code follows project style guidelines
  • Tests added and passing
  • CHANGELOG.md updated
  • Commit message follows conventional commits
  • PR title uses fix: prefix
  • Issue linked with Fixes #62533

Changed files

  • extensions/ollama/index.ts (modified, +11/-9)
  • extensions/ollama/src/embedding-provider.ts (modified, +3/-1)
  • extensions/ollama/src/provider-base-url.test.ts (added, +114/-0)
  • extensions/ollama/src/provider-base-url.ts (added, +41/-0)
  • extensions/ollama/src/setup.ts (modified, +3/-1)
  • extensions/ollama/src/web-search-provider.ts (modified, +3/-2)

Code Example

Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.595+07:00 [agent] embedded run failover decision: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 stage=assistant decision=fallback_model reason=model_not_found provider=ollama-lan/qwen3.5-32k:latest profile=-
Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.597+07:00 [diagnostic] lane task error: lane=subagent durationMs=6248 error="FailoverError: 404 {"error":"model 'qwen3.5-32k:latest' not found"}"
Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.598+07:00 [diagnostic] lane task error: lane=session:agent:main:subagent:e76b397e-4515-4121-af83-5e9c86ec7f25 durationMs=6249 error="FailoverError: 404 {"error":"model 'qwen3.5-32k:latest' not found"}"
Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.600+07:00 [model-fallback] model fallback decision: decision=candidate_failed requested=ollama-lan/qwen3.5-32k:latest candidate=ollama-lan/qwen3.5-32k:latest reason=model_not_found next=ollama-lan/qwen3.5-16k:latest
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.124+07:00 [agent] low context window: ollama-lan/qwen3.5-16k:latest ctx=16384 (warn<32000) source=modelsConfig
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.167+07:00 [skills] Skipping skill path that resolves outside its configured root.
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.559+07:00 [agent] embedded run agent end: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 isError=true model=qwen3.5-16k:latest provider=ollama-lan error=404 {"error":"model 'qwen3.5-16k:latest' not found"} rawError=404 {"error":"model 'qwen3.5-16k:latest' not found"}
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.571+07:00 [agent] embedded run failover decision: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 stage=assistant decision=fallback_model reason=model_not_found provider=ollama-lan/qwen3.5-16k:latest profile=-
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.573+07:00 [diagnostic] lane task error: lane=subagent durationMs=2971 error="FailoverError: 404 {"error":"model 'qwen3.5-16k:latest' not found"}"
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.573+07:00 [diagnostic] lane task error: lane=session:agent:main:subagent:e76b397e-4515-4121-af83-5e9c86ec7f25 durationMs=2972 error="FailoverError: 404 {"error":"model 'qwen3.5-16k:latest' not found"}"
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.575+07:00 [model-fallback] model fallback decision: decision=candidate_failed requested=ollama-lan/qwen3.5-32k:latest candidate=ollama-lan/qwen3.5-16k:latest reason=model_not_found next=none
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.577+07:00 [ws] ⇄ res ✗ agent errorCode=UNAVAILABLE errorMessage=FallbackSummaryError: All models failed (2): ollama-lan/qwen3.5-32k:latest: 404 {"error":"model 'qwen3.5-32k:latest' not found"} (model_not_found) | ollama-lan/qwen3.5-16k:latest: 404 {"error":"model 'qwen3.5-16k:latest' not found"} (model_... runId=e06359f9-8117-4e53-ae66-c2f2b566c006 error=FallbackSummaryError: All models failed (2): ollama-lan/qwen3.5-32k:latest: 404 {"error":"model 'qwen3.5-32k:latest' not found"} (model_not_found) | ollama-lan/qwen3.5-16k:latest: 404 {"error":"model 'qwen3.5-16k:latest' not found"} (model_... conn=bce09c9c…606e id=e59a3ad9…7a47
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Model "Not Found" (404) errors when using a remote Ollama provider, even though the model exists on the server and is reachable via curl - For a multiple ollama provider setup. Apparent root cause: the resolveOllamaBaseUrlForRun function in the Ollama provider appears to be defaulting to OLLAMA_NATIVE_BASE_URL (127.0.0.1:11434) because it's not correctly receiving or identifying the providerBaseUrl during the run. Feel free to let me know should you need more specific information about my configuration!

Steps to reproduce

  1. Configure openclaw with a local ollama host
  2. Configure a different ollama host as a fallback
  3. The fall back will never be used and you will get a 404 model not found as instead of pointing to the correct fallback host, the function resolveOllamaBaseUrlForRun defaults to 127.0.0.1

Expected behavior

Since I have 3x different hosts on my network serving models though ollama, I expect them to be reachable as a fallback, which is not possible at the moment.

Actual behavior

Instead of using baseUrl, the function resolveOllamaBaseUrlForRun seems to use const OLLAMA_NATIVE_BASE_URL = OLLAMA_DEFAULT_BASE_URL which is 127.0.0.1. Therefore any fallback to a different host configured in openclaw.json fails (unless it is local I guess).

OpenClaw version

2026.4.5

Operating system

CachyOS

Install method

npm global

Model

Gemma4:31B as default - Qwen3.5:latest as fallback (with 32K num_ctx)

Provider / routing chain

openclaw -> ollama on host 1 / fallback on host 2

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.595+07:00 [agent] embedded run failover decision: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 stage=assistant decision=fallback_model reason=model_not_found provider=ollama-lan/qwen3.5-32k:latest profile=-
Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.597+07:00 [diagnostic] lane task error: lane=subagent durationMs=6248 error="FailoverError: 404 {"error":"model 'qwen3.5-32k:latest' not found"}"
Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.598+07:00 [diagnostic] lane task error: lane=session:agent:main:subagent:e76b397e-4515-4121-af83-5e9c86ec7f25 durationMs=6249 error="FailoverError: 404 {"error":"model 'qwen3.5-32k:latest' not found"}"
Apr 07 20:15:04 major node[2306222]: 2026-04-07T20:15:04.600+07:00 [model-fallback] model fallback decision: decision=candidate_failed requested=ollama-lan/qwen3.5-32k:latest candidate=ollama-lan/qwen3.5-32k:latest reason=model_not_found next=ollama-lan/qwen3.5-16k:latest
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.124+07:00 [agent] low context window: ollama-lan/qwen3.5-16k:latest ctx=16384 (warn<32000) source=modelsConfig
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.167+07:00 [skills] Skipping skill path that resolves outside its configured root.
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.559+07:00 [agent] embedded run agent end: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 isError=true model=qwen3.5-16k:latest provider=ollama-lan error=404 {"error":"model 'qwen3.5-16k:latest' not found"} rawError=404 {"error":"model 'qwen3.5-16k:latest' not found"}
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.571+07:00 [agent] embedded run failover decision: runId=e06359f9-8117-4e53-ae66-c2f2b566c006 stage=assistant decision=fallback_model reason=model_not_found provider=ollama-lan/qwen3.5-16k:latest profile=-
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.573+07:00 [diagnostic] lane task error: lane=subagent durationMs=2971 error="FailoverError: 404 {"error":"model 'qwen3.5-16k:latest' not found"}"
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.573+07:00 [diagnostic] lane task error: lane=session:agent:main:subagent:e76b397e-4515-4121-af83-5e9c86ec7f25 durationMs=2972 error="FailoverError: 404 {"error":"model 'qwen3.5-16k:latest' not found"}"
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.575+07:00 [model-fallback] model fallback decision: decision=candidate_failed requested=ollama-lan/qwen3.5-32k:latest candidate=ollama-lan/qwen3.5-16k:latest reason=model_not_found next=none
Apr 07 20:15:07 major node[2306222]: 2026-04-07T20:15:07.577+07:00 [ws] ⇄ res ✗ agent errorCode=UNAVAILABLE errorMessage=FallbackSummaryError: All models failed (2): ollama-lan/qwen3.5-32k:latest: 404 {"error":"model 'qwen3.5-32k:latest' not found"} (model_not_found) | ollama-lan/qwen3.5-16k:latest: 404 {"error":"model 'qwen3.5-16k:latest' not found"} (model_... runId=e06359f9-8117-4e53-ae66-c2f2b566c006 error=FallbackSummaryError: All models failed (2): ollama-lan/qwen3.5-32k:latest: 404 {"error":"model 'qwen3.5-32k:latest' not found"} (model_not_found) | ollama-lan/qwen3.5-16k:latest: 404 {"error":"model 'qwen3.5-16k:latest' not found"} (model_... conn=bce09c9c…606e id=e59a3ad9…7a47

Impact and severity

Anyone with multiple ollama hosts on their network

Additional information

No response

extent analysis

TL;DR

The issue can be resolved by ensuring the resolveOllamaBaseUrlForRun function correctly identifies and uses the providerBaseUrl instead of defaulting to OLLLAMA_NATIVE_BASE_URL.

Guidance

  1. Verify Configuration: Check the openclaw.json configuration file to ensure that the providerBaseUrl for each Ollama host is correctly specified.
  2. Inspect resolveOllamaBaseUrlForRun Function: Review the resolveOllamaBaseUrlForRun function in the Ollama provider code to understand why it is defaulting to OLLLAMA_NATIVE_BASE_URL instead of using the provided providerBaseUrl.
  3. Test with Local Host: Test the setup with a local Ollama host to see if the issue persists, which can help determine if the problem is related to the fallback mechanism or the resolveOllamaBaseUrlForRun function itself.
  4. Check Network Connectivity: Ensure that there are no network connectivity issues between the machine running OpenClaw and the remote Ollama hosts.

Example

No specific code example can be provided without modifying the existing codebase, but ensuring that the providerBaseUrl is correctly passed to and used by the resolveOllamaBaseUrlForRun function is key.

Notes

The solution may involve modifying the Ollama provider code to correctly handle multiple hosts and their base URLs. The exact changes will depend on the specifics of the resolveOllamaBaseUrlForRun function and how it is currently implemented.

Recommendation

Apply a workaround by manually specifying the correct base URL for each Ollama host in the configuration, if possible, until a permanent fix can be implemented in the resolveOllamaBaseUrlForRun function.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Since I have 3x different hosts on my network serving models though ollama, I expect them to be reachable as a fallback, which is not possible at the moment.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - ✅(Solved) Fix [Bug]: Model "Not Found" (404) errors when using a remote Ollama provider as a fallback [1 pull requests, 1 participants]