openclaw - ✅(Solved) Fix CLI memory commands crash with 'Unknown memory embedding provider: ollama' [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#66163Fetched 2026-04-14 05:38:57
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Error Message

Error: Unknown memory embedding provider: ollama at getAdapter (manager-FzeN0TEi.js:341:22) at createEmbeddingProvider (manager-FzeN0TEi.js:393:25) at MemoryIndexManager.loadProviderResult (manager-FzeN0TEi.js:2759:16)

Root Cause

The ollama embedding provider is registered by the ollama plugin at runtime via api.registerMemoryEmbeddingProvider(ollamaMemoryEmbeddingProviderAdapter) (in extensions/ollama/index.js).

However, CLI memory commands use registerBuiltInMemoryEmbeddingProviders() (in manager-FzeN0TEi.js) which only registers 5 hardcoded providers: local, openai, gemini, voyage, mistral. The CLI code path does not load plugins, so the ollama adapter is never registered.

The gateway runtime works fine because it loads plugins before initializing the memory system. Only CLI commands are affected.

Fix Action

Fix / Workaround

This bug has a secondary data-privacy implication: if a user sets provider: "auto" as a workaround, the auto-select priority chain is local(10) → openai(20) → gemini(30) → voyage(40) → mistral(50). Ollama has no autoSelectPriority so it is never selected by auto-select, and users who want local/self-hosted embeddings could inadvertently send their memory data to OpenAI.

PR fix notes

PR #66269: fix(memory): restore ollama embedding adapter

Description (problem / solution / changelog)

Summary

  • Problem: explicit memorySearch.provider: "ollama" regressed because memory-core no longer registers a built-in ollama embedding adapter.
  • Why it matters: openclaw memory status, memory search bootstrap, and related explicit Ollama embedding flows fail with Unknown memory embedding provider: ollama.
  • What changed: restore the built-in ollama adapter in memory-core, include endpoint-sensitive cache-key data so different Ollama hosts do not collide, add a focused regression test, and add the changelog entry.
  • What did NOT change (scope boundary): this PR does not change the broader capability-fallback behavior in src/plugins/memory-embedding-provider-runtime.ts; it fixes the concrete built-in adapter regression on current main.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • Docs
  • Security hardening
  • Chore/infra

Scope (select all touched areas)

  • Gateway / orchestration
  • Skills / tool execution
  • Auth / tokens
  • Memory / storage
  • Integrations
  • API / contracts
  • UI / DX
  • CI/CD / infra

Linked Issue/PR

  • Closes #63429
  • Related #66078
  • Related #66163
  • Related #66112
  • Related #63632
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: extensions/memory-core/src/memory/provider-adapters.ts stopped including the built-in ollama adapter, so the runtime registry only contained the other built-ins and explicit ollama resolution failed fast.
  • Missing detection / guardrail: there was no focused regression test asserting that built-in Ollama registration stays present.
  • Contributing context (if known): the contributor PR also surfaced that cache-key data should include endpoint-specific fields to avoid collisions across multiple Ollama hosts.

Regression Test Plan (if applicable)

  • Coverage level that should have caught this:
    • Unit test
    • Seam / integration test
    • End-to-end test
    • Existing coverage already sufficient
  • Target test or file: extensions/memory-core/src/memory/index.test.ts
  • Scenario the test should lock in: built-in registration includes the ollama adapter with the shared default model.
  • Why this is the smallest reliable guardrail: the regression is a missing built-in adapter entry, so the smallest direct check is the registered adapter list.
  • Existing test that already covers this (if any): extensions/memory-core/src/memory/manager.mistral-provider.test.ts already covers the shared embedding-provider request path.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

  • Explicit Ollama memory embeddings work again through the built-in memory-core adapter path.
  • Embedding cache keys now distinguish different Ollama hosts for the same model name.

Diagram (if applicable)

N/A

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (No)
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)
  • If any Yes, explain risk + mitigation:

Repro + Verification

Environment

  • OS: macOS
  • Runtime/container: local repo checkout
  • Model/provider: Ollama memory embeddings
  • Integration/channel (if any): memory-core
  • Relevant config (redacted): explicit memorySearch.provider: "ollama"

Steps

  1. Run pnpm test:serial extensions/memory-core/src/memory/index.test.ts -t "registers the builtin ollama embedding provider"
  2. Run pnpm test:serial extensions/memory-core/src/memory/manager.mistral-provider.test.ts

Expected

  • Built-in Ollama registration is present and the focused memory-core test slice passes.

Actual

  • Before this PR, explicit Ollama registration was missing from the built-in adapter list.

Evidence

  • Failing test/log before + passing after
  • Trace/log snippets
  • Screenshot/recording
  • Perf numbers (if relevant)

Human Verification (required)

  • Verified scenarios: focused built-in registration test and manager.mistral-provider test both passed locally.
  • Edge cases checked: cache-key data now includes baseUrl and sanitized headers so different Ollama endpoints do not share cached embeddings.
  • What you did not verify: a full repo-wide test lane; a broader serial run in this sparse maintainer worktree hit unrelated existing contract failures outside the touched memory-core surface.

Review Conversations

  • I replied to or resolved every bot review conversation I addressed in this PR.
  • I left unresolved only the conversations that still need reviewer or maintainer judgment.

Compatibility / Migration

  • Backward compatible? (Yes)
  • Config/env changes? (No)
  • Migration needed? (No)
  • If yes, exact upgrade steps:

Risks and Mitigations

  • Risk: none beyond restoring a missing built-in adapter and tightening its cache identity.
    • Mitigation: focused regression coverage and preserved adapter semantics from the existing Ollama extension path.

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/memory-core/src/memory/index.test.ts (modified, +17/-1)
  • extensions/memory-core/src/memory/provider-adapters.ts (modified, +29/-0)

Code Example

Error: Unknown memory embedding provider: ollama
    at getAdapter (manager-FzeN0TEi.js:341:22)
    at createEmbeddingProvider (manager-FzeN0TEi.js:393:25)
    at MemoryIndexManager.loadProviderResult (manager-FzeN0TEi.js:2759:16)

---

openclaw memory status
   openclaw memory backup
   openclaw memory rebuild
RAW_BUFFERClick to expand / collapse

Bug Description

openclaw memory status, openclaw memory backup, and openclaw memory rebuild crash with:

Error: Unknown memory embedding provider: ollama
    at getAdapter (manager-FzeN0TEi.js:341:22)
    at createEmbeddingProvider (manager-FzeN0TEi.js:393:25)
    at MemoryIndexManager.loadProviderResult (manager-FzeN0TEi.js:2759:16)

Root Cause

The ollama embedding provider is registered by the ollama plugin at runtime via api.registerMemoryEmbeddingProvider(ollamaMemoryEmbeddingProviderAdapter) (in extensions/ollama/index.js).

However, CLI memory commands use registerBuiltInMemoryEmbeddingProviders() (in manager-FzeN0TEi.js) which only registers 5 hardcoded providers: local, openai, gemini, voyage, mistral. The CLI code path does not load plugins, so the ollama adapter is never registered.

The gateway runtime works fine because it loads plugins before initializing the memory system. Only CLI commands are affected.

Steps to Reproduce

  1. Configure agents.defaults.memorySearch.provider to "ollama" with a valid remote Ollama endpoint
  2. Run any CLI memory command:
    openclaw memory status
    openclaw memory backup
    openclaw memory rebuild
  3. All crash with Unknown memory embedding provider: ollama

Expected Behavior

CLI memory commands should recognize ollama as a valid embedding provider, since the ollama plugin is bundled and enabled.

Suggested Fix

Either:

  1. Include ollama in builtinMemoryEmbeddingProviderAdapters in the manager (like local/openai/gemini/voyage/mistral), or
  2. Have CLI memory commands load plugin-registered embedding providers before initializing the memory index

Option 1 seems simplest since ollama is a bundled first-party extension.

Additional Context

  • Version: 2026.4.12
  • OS: macOS arm64 (Apple Silicon)
  • Ollama config: provider: "ollama", model: "snowflake-arctic-embed2", remote.baseUrl: "http://<tailscale-ip>:11434", fallback: "none"
  • Gateway memory_search works perfectly — only CLI commands are broken
  • The builtinMemoryEmbeddingProviderAdapters array in manager also lacks lmstudio and bedrock, which are documented as valid provider values in the runtime schema but would presumably hit the same bug

Privacy/Security Note

This bug has a secondary data-privacy implication: if a user sets provider: "auto" as a workaround, the auto-select priority chain is local(10) → openai(20) → gemini(30) → voyage(40) → mistral(50). Ollama has no autoSelectPriority so it is never selected by auto-select, and users who want local/self-hosted embeddings could inadvertently send their memory data to OpenAI.

extent analysis

TL;DR

The most likely fix is to include ollama in the builtinMemoryEmbeddingProviderAdapters array in the manager.

Guidance

  • Verify that the ollama plugin is correctly registered and enabled in the system.
  • Check the manager-FzeN0TEi.js file to ensure that the builtinMemoryEmbeddingProviderAdapters array only includes the hardcoded providers local, openai, gemini, voyage, and mistral.
  • Consider adding ollama to the builtinMemoryEmbeddingProviderAdapters array as a simple fix, as suggested in the issue.
  • Alternatively, explore modifying the CLI memory commands to load plugin-registered embedding providers before initializing the memory index.

Example

No code snippet is provided, as the issue does not require a specific code example to understand the fix.

Notes

The issue is specific to CLI memory commands and does not affect the gateway runtime. The fix should ensure that the ollama provider is recognized by the CLI commands.

Recommendation

Apply the workaround by including ollama in the builtinMemoryEmbeddingProviderAdapters array, as it seems to be the simplest solution. This will allow the CLI memory commands to recognize ollama as a valid embedding provider.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING