Repository navigation
Description
Summary
The builtin memory search provider resolution ignores the configured memorySearch.provider field and its associated provider's baseUrl, routing embedding requests to whichever Ollama instance resolves first on the network instead.
When memorySearch.provider is set to "ollama-cpu" with a custom baseUrl pointing at http://127.0.0.1:11434, gateway logs show it acknowledges the requested provider ((requested: ollama-cpu)) but connects to the wrong Ollama instance — often a remote inference box rather than the configured local endpoint.
Steps to Reproduce
-
Configure two Ollama instances:
- Local on
localhost:11434(OpenClaw host) with embedding model pulled but not loaded - Remote on a separate machine (e.g.
10.0.0.250:11434) with embedding model loaded and active
- Local on
-
Set provider config in
openclaw.json:
{
"models": {
"providers": {
"ollama-cpu": {
"type": "ollama",
"baseUrl": "http://127.0.0.1:11434"
}
}
},
"agents": {
"defaults": {
"memorySearch": {
"provider": "ollama-cpu",
"model": "qwen3-embedding:4b"
}
}
}
}-
Enable session transcript indexing (
experimental.sessionMemory: true,sources: ["memory", "sessions"]) -
Observe gateway logs during embedding work:
Provider: ollama (requested: ollama-cpu)
Model: qwen3-embedding:4b
baseUrl: http://127.0.0.1:11434
- Monitor GPU activity on the remote inference box — embedding requests hit there despite
baseUrlpointing at localhost
Expected Behavior
Embedding requests route to http://127.0.0.1:11434 (the configured ollama-cpu endpoint). The (requested: ollama-cpu) annotation in logs should match the actual provider used.
Actual Behavior
The provider is resolved as ollama (the primary/default provider) and requests go to whichever Ollama instance responds first on the network, ignoring the baseUrl override entirely. No errors or warnings are logged — the misrouted request succeeds silently.
Environment
- OpenClaw: 2026.6.10
- Backend: builtin memory engine (not QMD)
- Memory provider:
ollama-cpu→http://127.0.0.1:11434 - Embedding model:
qwen3-embedding:4b
Evidence
Gateway logs consistently show (requested: ollama-cpu) but the resolved provider is always ollama. Confirmed by observing GPU activity (nvtop) on the remote inference box during local memory indexing operations. The local Ollama instance has the embedding model pulled but idle — it never receives requests despite being the configured endpoint.
First identified June 12, 2026. Persisted through multiple gateway restarts and config changes.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jun 26, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 26, 2026, 7:51 PM ET / 23:51 UTC.
Summary
Keep open: current main still drops the configured custom Ollama memory provider id before endpoint lookup, and the issue is already paired with an open candidate fix PR that should be reviewed rather than closing the issue early.
Reproducibility: yes. Source inspection shows current main resolves a custom provider id to the Ollama memory adapter, then drops or overwrites that id before
resolveConfiguredProvidercan use its configuredbaseUrl.Root-cause cluster
Relationship:
canonicalCanonical: #97055
Summary: This issue is the currently open canonical report for the remaining custom Ollama memory provider endpoint-loss bug; the open linked PR is the active candidate fix.
Members:
fixed_by_candidate: fix(ollama): preserve custom memory provider endpoints #97059 - The PR is open, uses closing syntax for this issue, and targets the same gateway and Ollama adapter provider-id propagation failure.duplicate: memorySearch custmom providers.providers.<id> with api: ollama ignores custom baseUrl #96742 - The closed issue reports the same custommodels.providers.<id>withapi: "ollama"losing its configuredbaseUrlwhen used asmemorySearch.provider.same_root_cause: fix(ollama): preserve custom provider id through memory embedding adapter (#96742) #96764 - The closed unmerged PR proposed the same two-layer provider-id propagation repair with focused proof, but it is not a viable canonical landing target because it is closed.partial_overlap:memorySearch.providercannot target custom provider ids, limiting multi-Ollama / multi-GPU setups #73150 - The older closed issue covered the broader custom memory provider id limitation; current source supports resolving custom ids, while this issue covers the remaining Ollama endpoint-loss path.partial_overlap: [AI] fix(agents): route memory embedding through generic resolution when provider has custom baseUrl #93853 - The open PR addresses broader memory provider override routing for custom base URLs, but it does not directly own this issue's exact custom Ollama memory adapter endpoint/cache-identity fix.Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.
Next step
No new repair lane: #97059 is already the open implementation candidate for this issue and should be reviewed, landed, or closed first.
Review details
Best possible solution:
Review and land a focused fix that preserves the requested provider id through gateway memory-specific adapter creation and the Ollama memory adapter, with regression coverage and explicit cache identity upgrade handling.
Do we have a high-confidence way to reproduce the issue?
Yes. Source inspection shows current main resolves a custom provider id to the Ollama memory adapter, then drops or overwrites that id before
resolveConfiguredProvidercan use its configuredbaseUrl.Is this the best way to solve the issue?
Yes for the issue direction: the narrow maintainable fix is to pass the existing provider id through the gateway memory-specific path and stop the Ollama adapter from hardcoding the base provider. The open linked PR should be reviewed and landed or replaced before closing this issue.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against e0932e0bc4e1.
Label changes
Label changes:
clawsweeper:linked-pr-open: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state no longer selects this label.clawsweeper:queueable-fix: Current issue advisory state no longer selects this label.Label justifications:
P2: This is a documented custom Ollama memory provider-routing bug with limited provider-specific blast radius.impact:auth-provider: The issue affects provider selection plus endpoint, header, and auth resolution for custom Ollama memory embedding providers.Evidence reviewed
What I checked:
memorySearch.providermay point at a custommodels.providers.<id>entry and should preserve that custom provider id for endpoint, auth, and model-prefix handling. Public docs:docs/reference/memory-config.md. (docs/reference/memory-config.md:84, e0932e0bc4e1)apiisollamacan select the Ollama memory embedding adapter. (src/plugins/memory-embedding-provider-runtime.ts:40, e0932e0bc4e1)createWithAdaptercallsadapter.createwithoutprovider: providerId, while the generic fallback path passesprovider: providerId; this leaves memory-specific adapters without the configured custom id. (src/gateway/embeddings-http.ts:132, e0932e0bc4e1)provider: "ollama", preventing downstream config lookup from seeing ids such asollama-cpu. (extensions/ollama/src/memory-embedding-adapter.ts:14, e0932e0bc4e1)resolveConfiguredProviderreadsoptions.providerfromconfig.models.providers, andresolveOllamaEmbeddingClientderives the embedding base URL from that resolved provider config. (extensions/ollama/src/embedding-provider.ts:148, e0932e0bc4e1)Likely related people:
docs/reference/memory-config.md,src/agents/memory-search.ts,src/plugins/memory-embedding-provider-runtime.ts)src/gateway/embeddings-http.ts,src/plugins/openai-compatible-embedding-provider.ts,extensions/memory-core/src/memory/embeddings.ts)extensions/ollama/src/memory-embedding-adapter.ts,extensions/ollama/src/embedding-provider.ts,extensions/ollama/src/embedding-provider.test.ts)src/gateway/embeddings-http.ts,extensions/ollama/src/memory-embedding-adapter.ts,extensions/ollama/src/embedding-provider.test.ts)src/gateway/embeddings-http.ts,extensions/ollama/src/memory-embedding-adapter.ts,extensions/ollama/src/embedding-provider.test.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.steipete commentedon Jul 21, 2026
Fixed on
main.The provider-id routing portion landed earlier in
fa5f24b021eandb085184d085. PR #97059 now closes the residual cache-identity gap: custom/explicit Ollama endpoints receive distinct provider keys, custom header identity is hashed without retaining raw values, and the implicit default Ollama route keeps its shipped key.Landed commit: 9405f2c
Proof: 29 focused tests, complete core/extension changed gates, clean final AutoReview, and exact-head
openclaw/ci-gateplus 79 hosted checks green.