openclaw - 💡(How to fix) Fix memory_search tool can fail with CredentialsProviderError while CLI works after switching to local embeddings [1 participants]

Official PRs (…)
ON THIS PAGE

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#70577Fetched 2026-04-24 05:56:10
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants

In a real local install, the built-in memory_search tool kept failing with:

Could not load credentials from any providers

while the underlying memory store was present and openclaw memory status --deep reported a configured provider. I was able to repair the CLI/runtime by switching agents.defaults.memorySearch.provider to local and installing node-llama-cpp, but the built-in tool in the live agent session still continued returning the old credential error.

That leaves two likely issues:

  1. the live memory_search tool host is holding stale provider state / stale manager state after config changes and gateway restart, and/or
  2. the tool path is not honoring the same provider/runtime initialization path that openclaw memory status / openclaw memory search now use successfully.

This looks related to stale-provider reports like #61098, but the symptom here is a credential-provider failure instead of continuing to call the previous remote backend explicitly.

Error Message

Memory search failed: Could not load credentials from any providers [memory] sync failed (session-start): CredentialsProviderError: Could not load credentials from any providers [memory] sync failed (search): CredentialsProviderError: Could not load credentials from any providers

Root Cause

This makes memory recovery confusing:

  • users repair the config
  • the CLI proves embeddings are healthy
  • but the tool the agent must use still reports the old credential error

So the user sees "memory is still broken" even after a valid repair.

Fix Action

Fix / Workaround

  • #61098 — memory_search uses stale embedding provider after config.patch + restart
  • #55608 — CLI/tool config divergence in other memory paths
  • #47251 / #57390 — local memory embeddings break if node-llama-cpp is not present

Code Example

Could not load credentials from any providers

---

"agents": {
  "defaults": {
    "memorySearch": {
      "enabled": true,
      "fallback": "none",
      "model": "text-embedding-3-small"
    }
  }
}

---

"provider": "bedrock",
"requestedProvider": "auto",
"embeddingProbe": {
  "ok": false,
  "error": "Could not load credentials from any providers"
}

---

Memory search failed: Could not load credentials from any providers
[memory] sync failed (session-start): CredentialsProviderError: Could not load credentials from any providers
[memory] sync failed (search): CredentialsProviderError: Could not load credentials from any providers

---

"agents": {
  "defaults": {
    "memorySearch": {
      "provider": "local",
      "model": "hf:ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf",
      "fallback": "none",
      "enabled": true
    }
  }
}

---

Cannot find package 'node-llama-cpp' imported from .../engine-embeddings-*.js

---

npm i -g node-llama-cpp

---

openclaw memory status --json --deep

---

"provider": "local",
"requestedProvider": "local",
"embeddingProbe": { "ok": true }

---

{
  "disabled": true,
  "unavailable": true,
  "error": "Could not load credentials from any providers"
}
RAW_BUFFERClick to expand / collapse

Summary

In a real local install, the built-in memory_search tool kept failing with:

Could not load credentials from any providers

while the underlying memory store was present and openclaw memory status --deep reported a configured provider. I was able to repair the CLI/runtime by switching agents.defaults.memorySearch.provider to local and installing node-llama-cpp, but the built-in tool in the live agent session still continued returning the old credential error.

That leaves two likely issues:

  1. the live memory_search tool host is holding stale provider state / stale manager state after config changes and gateway restart, and/or
  2. the tool path is not honoring the same provider/runtime initialization path that openclaw memory status / openclaw memory search now use successfully.

This looks related to stale-provider reports like #61098, but the symptom here is a credential-provider failure instead of continuing to call the previous remote backend explicitly.

Environment

  • OpenClaw: 2026.4.21
  • macOS arm64
  • Node: v25.6.1
  • Global install via npm
  • Workspace memory backend: builtin / memory-core

Initial failing state

Config included:

"agents": {
  "defaults": {
    "memorySearch": {
      "enabled": true,
      "fallback": "none",
      "model": "text-embedding-3-small"
    }
  }
}

openclaw memory status --json --deep showed:

"provider": "bedrock",
"requestedProvider": "auto",
"embeddingProbe": {
  "ok": false,
  "error": "Could not load credentials from any providers"
}

and openclaw memory search --query "Mohammad" failed with:

Memory search failed: Could not load credentials from any providers
[memory] sync failed (session-start): CredentialsProviderError: Could not load credentials from any providers
[memory] sync failed (search): CredentialsProviderError: Could not load credentials from any providers

No AWS/Bedrock/OpenAI env vars were set in the shell.

What fixed the CLI/runtime

I changed config to:

"agents": {
  "defaults": {
    "memorySearch": {
      "provider": "local",
      "model": "hf:ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf",
      "fallback": "none",
      "enabled": true
    }
  }
}

Then restarted the gateway.

At first local embeddings failed because node-llama-cpp was missing:

Cannot find package 'node-llama-cpp' imported from .../engine-embeddings-*.js

Installing it globally fixed that:

npm i -g node-llama-cpp

After that:

openclaw memory status --json --deep

reported:

"provider": "local",
"requestedProvider": "local",
"embeddingProbe": { "ok": true }

and the model downloaded successfully and initialized.

Remaining bug

After the fix above, the CLI path works, but the built-in memory_search tool in the live agent session still returns:

{
  "disabled": true,
  "unavailable": true,
  "error": "Could not load credentials from any providers"
}

So the tool/runtime still appears stuck on the old credential-failing provider state even though:

  • config on disk is updated
  • gateway has restarted
  • CLI deep status now probes local embeddings successfully

Why this matters

This makes memory recovery confusing:

  • users repair the config
  • the CLI proves embeddings are healthy
  • but the tool the agent must use still reports the old credential error

So the user sees "memory is still broken" even after a valid repair.

Suspected root cause

Likely one of:

  1. stale singleton / manager cache in the live tool host
  2. the built-in tool captures provider config too early and doesn't re-resolve after restart/config change
  3. the tool path is separate from CLI path and still auto-selects a remote provider when it should now be using local

Related issues

  • #61098 — memory_search uses stale embedding provider after config.patch + restart
  • #55608 — CLI/tool config divergence in other memory paths
  • #47251 / #57390 — local memory embeddings break if node-llama-cpp is not present

Suggested fixes

  1. Make the built-in memory_search tool re-resolve provider/manager state after restart instead of using stale cached state.
  2. Ensure tool and CLI share the same provider resolution path and current config source.
  3. If provider changes from remote->local, clear any stale embedding manager cache automatically.
  4. Improve the tool error so it distinguishes:
    • stale cached provider state
    • missing local dependency (node-llama-cpp)
    • real remote credential failure

extent analysis

TL;DR

The built-in memory_search tool in the live agent session may be using stale provider state, and updating the provider to local and installing node-llama-cpp fixes the CLI/runtime, but not the live tool.

Guidance

  • Verify that the agents.defaults.memorySearch.provider is set to local in the config file and that node-llama-cpp is installed globally.
  • Check if the live agent session is using a stale singleton or manager cache by restarting the gateway and checking if the issue persists.
  • Ensure that the tool and CLI share the same provider resolution path and current config source to prevent config divergence.
  • Consider implementing a mechanism to clear stale embedding manager cache automatically when the provider changes from remote to local.

Example

No code snippet is provided as the issue is more related to configuration and caching.

Notes

The issue seems to be related to stale provider state and caching, and the suggested fixes aim to address this. However, the root cause is not entirely clear, and further investigation may be needed to determine the exact cause of the issue.

Recommendation

Apply workaround: Update the provider to local and install node-llama-cpp to fix the CLI/runtime, and then investigate further to resolve the issue with the built-in memory_search tool in the live agent session. This is because the workaround has been shown to fix the CLI/runtime, but the live tool still requires further investigation.

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_search tool can fail with CredentialsProviderError while CLI works after switching to local embeddings [1 participants]