openclaw - 💡(How to fix) Fix Memory embeddings: provider=ollama ignored, calls Gemini instead [1 comments, 2 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#60100Fetched 2026-04-08 02:36:19
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Timeline (top)
commented ×1

Error Message

  1. Error: API key not valid (Gemini endpoint) Gemini embedding provider is called with stale credentials, returning "API key not valid" error on every session-start or search query.

Root Cause

Transport routing issue: when provider: "ollama" and transport: "remote":

  • includeRemote = true (because primaryAdapter?.transport !== "local")
  • Auth resolution diverges and calls Gemini auth ID instead of Ollama
  • The auth-profiles lookup for ollama should map to Ollama credentials, not Google

Likely in: manager-*.js or memory-search-*.js where provider → auth resolution happens.

Fix Action

Workaround

Disable memory search entirely: agents.defaults.memorySearch.enabled = false

RAW_BUFFERClick to expand / collapse

Bug Description

When agents.defaults.memorySearch.provider is set to ollama, the gateway ignores this setting and calls Gemini embedding API instead, using stale auth credentials from auth-profiles.json.

Reproduction

  1. Config: agents.defaults.memorySearch.provider = "ollama" (valid adapter, registered in builtinMemoryEmbeddingProviderAdapters)
  2. Session starts or search query runs
  3. Gateway calls createEmbeddingProvider with correct provider ID
  4. resolveMemorySearchConfig correctly merges config and returns provider: "ollama"
  5. BUT: createEmbeddingProvider somehow routes to Gemini instead of Ollama adapter
  6. Auth resolution pulls google:default profile from auth-profiles.json (stale key)
  7. Error: API key not valid (Gemini endpoint)

Root Cause

Transport routing issue: when provider: "ollama" and transport: "remote":

  • includeRemote = true (because primaryAdapter?.transport !== "local")
  • Auth resolution diverges and calls Gemini auth ID instead of Ollama
  • The auth-profiles lookup for ollama should map to Ollama credentials, not Google

Likely in: manager-*.js or memory-search-*.js where provider → auth resolution happens.

Environment

  • OpenClaw v2026.3.28
  • Node 22.22.0
  • Ollama local (http://localhost:11434)
  • Config: {"provider": "ollama", "remote": false, "local": {"modelPath": "nomic-embed-text"}}

Expected Behavior

When provider=ollama is set, use Ollama adapter. Auth resolution should not touch Gemini.

Actual Behavior

Gemini embedding provider is called with stale credentials, returning "API key not valid" error on every session-start or search query.

Workaround

Disable memory search entirely: agents.defaults.memorySearch.enabled = false

extent analysis

TL;DR

Update the auth resolution logic to correctly map the Ollama provider to its credentials instead of using the Gemini auth ID.

Guidance

  • Verify that the auth-profiles.json file contains the correct credentials for the Ollama provider.
  • Check the manager-*.js or memory-search-*.js files for the logic that maps providers to auth resolutions and update it to correctly handle the Ollama provider.
  • Test the updated logic with the agents.defaults.memorySearch.provider set to ollama to ensure it uses the correct adapter and credentials.
  • Consider updating the includeRemote logic to correctly handle the transport setting when the provider is set to ollama.

Example

No code example is provided as the issue does not contain enough information to generate a specific code snippet.

Notes

The provided workaround of disabling memory search entirely may not be desirable in all cases, and updating the auth resolution logic is likely a more suitable long-term solution.

Recommendation

Apply workaround: Disable memory search entirely by setting agents.defaults.memorySearch.enabled to false until the auth resolution logic can be updated to correctly handle the Ollama provider. This is a temporary solution to prevent errors, but it may not be desirable in all cases.

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

openclaw - 💡(How to fix) Fix Memory embeddings: provider=ollama ignored, calls Gemini instead [1 comments, 2 participants]