Skip to content

CLI memory commands crash with 'Unknown memory embedding provider: ollama' #66163

@mtblackman16

Description

@mtblackman16

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions