openclaw - ✅(Solved) Fix Local memorySearch runtime deps are not retained/resolved in plugin-runtime-deps [1 pull requests, 2 comments, 3 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#74777Fetched 2026-05-01 05:41:26
View on GitHub
Comments
2
Participants
3
Timeline
8
Reactions
2
Author
Timeline (top)
cross-referenced ×5commented ×2closed ×1

Local memorySearch fails because OpenClaw's managed plugin-runtime-deps environment does not retain or resolve packages required by the local memory runtime.

Observed missing packages:

  • node-llama-cpp
  • sqlite-vec
  • chokidar

The main failure is:

Local embeddings unavailable.
Reason: optional dependency node-llama-cpp is missing (or failed to install).
Detail: Cannot find package 'node-llama-cpp' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/memory-core-host-engine-embeddings-BDFBUqKJ.js

Error Message

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'chokidar' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/manager-jzSMQjEt.js

  • Update the local embeddings error message if global install is not expected to be resolvable from the managed runtime directory.

Root Cause

Local memorySearch fails because OpenClaw's managed plugin-runtime-deps environment does not retain or resolve packages required by the local memory runtime.

Fix Action

Fix / Workaround

Workaround Used Locally

Then I patched the generated runtime bundle to import those global package entrypoints by absolute file:// URL:

After this workaround:

PR fix notes

PR #74802: fix(memory): install local embedding runtime deps

Description (problem / solution / changelog)

Summary

  • Problem: local memory search can select the bundled memory-core runtime without installing node-llama-cpp into the managed plugin runtime dependency root.
  • Why it matters: agents.defaults.memorySearch.provider = "local" can fail before indexing/search starts with Cannot find package 'node-llama-cpp' even when the model file exists or the package is installed globally.
  • What changed: add [email protected] to bundled runtime dependency selection when memory-core is included and local memory search is configured; update the local setup hint to use openclaw doctor --fix.
  • What did NOT change (scope boundary): no root/package dependency is added for node-llama-cpp, preserving the release guardrail that keeps it operator-installed/managed runtime only.

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 #74777
  • This PR fixes a bug or regression

Root Cause (if applicable)

  • Root cause: local embeddings import node-llama-cpp from the managed plugin runtime, but runtime dependency selection did not include that package for local memory search.
  • Missing detection / guardrail: bundled runtime dependency tests covered declared plugin package dependencies, but not config-gated optional local embedding runtime deps.
  • Contributing context (if known): reproduced from a local memory_search failure where plugin-runtime-deps lacked node-llama-cpp despite global installation.

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: src/plugins/bundled-runtime-deps.test.ts
  • Scenario the test should lock in: scanning/ensuring bundled runtime deps includes [email protected] only when local memory search is enabled.
  • Why this is the smallest reliable guardrail: the bug is in runtime dependency selection, before embeddings execute.
  • Existing test that already covers this (if any): none for the config-gated local embedding runtime dep.
  • If no new test is added, why not: N/A

User-visible / Behavior Changes

openclaw doctor --fix and gateway startup can repair/install the local embedding runtime dependency into the managed runtime when local memory search is configured. The missing-runtime hint now points users to openclaw doctor --fix instead of global npm installation.

Diagram (if applicable)

Before:
[local memorySearch config] -> [memory-core runtime deps] -> [chokidar only] -> [node-llama-cpp import fails]

After:
[local memorySearch config] -> [memory-core runtime deps] -> [chokidar + node-llama-cpp] -> [local embeddings can load]

Security Impact (required)

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

Repro + Verification

Environment

  • OS: Linux
  • Runtime/container: local pnpm workspace
  • Model/provider: local memory search provider
  • Integration/channel (if any): N/A
  • Relevant config (redacted): agents.defaults.memorySearch.provider = "local"

Steps

  1. Configure local memory search.
  2. Start or repair bundled memory-core runtime deps.
  3. Exercise runtime dependency scan/ensure paths.

Expected

Actual

  • Before this fix, the managed runtime deps did not include node-llama-cpp, so bare import resolution failed from plugin-runtime-deps.

Evidence

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

Human Verification (required)

  • Verified scenarios:
    • pnpm exec vitest run src/plugins/bundled-runtime-deps.test.ts --config test/vitest/vitest.plugins.config.ts
    • pnpm exec vitest run extensions/memory-core/src/memory/embeddings.test.ts extensions/memory-core/src/memory/search-manager.test.ts --config test/vitest/vitest.extension-memory.config.ts
    • pnpm exec vitest run test/openclaw-npm-release-check.test.ts --config test/vitest/vitest.tooling.config.ts
    • pnpm exec oxfmt --check --threads=1 src/plugins/bundled-runtime-deps-selection.ts src/plugins/bundled-runtime-deps.test.ts extensions/memory-core/src/memory/provider-adapters.ts
    • pnpm tsgo:core
    • pnpm check:changed
  • Edge cases checked: disabled local memory search does not add node-llama-cpp.
  • What you did not verify: full end-to-end local embedding model load with native node-llama-cpp in the managed runtime.

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/No): Yes
  • Config/env changes? (Yes/No): No
  • Migration needed? (Yes/No): No
  • If yes, exact upgrade steps: N/A

Risks and Mitigations

  • Risk: node-llama-cpp native install can still fail on unsupported local toolchains.
    • Mitigation: dependency remains config-gated to local memory search and the setup hint points users to the managed repair path plus pnpm rebuild guidance.

Changed files

  • extensions/memory-core/src/memory/provider-adapters.ts (modified, +2/-2)
  • src/plugins/bundled-runtime-deps-selection.ts (modified, +127/-5)
  • src/plugins/bundled-runtime-deps.test.ts (modified, +230/-0)

Code Example

Local embeddings unavailable.
Reason: optional dependency node-llama-cpp is missing (or failed to install).
Detail: Cannot find package 'node-llama-cpp' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/memory-core-host-engine-embeddings-BDFBUqKJ.js

---

Embeddings: ready
Vector: ready

---

npm i -g node-llama-cpp@3.18.1

---

~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/

---

sqlite-vec unavailable: Cannot find package 'sqlite-vec' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/engine-storage-CO3qFXo7.js

---

Embeddings: ready
Vector: unavailable

---

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'chokidar' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/manager-jzSMQjEt.js

---

npm i -g node-llama-cpp@3.18.1 sqlite-vec@0.1.9 chokidar@^5.0.0

---

Embeddings: ready
Vector: ready
FTS: ready
RAW_BUFFERClick to expand / collapse

Summary

Local memorySearch fails because OpenClaw's managed plugin-runtime-deps environment does not retain or resolve packages required by the local memory runtime.

Observed missing packages:

  • node-llama-cpp
  • sqlite-vec
  • chokidar

The main failure is:

Local embeddings unavailable.
Reason: optional dependency node-llama-cpp is missing (or failed to install).
Detail: Cannot find package 'node-llama-cpp' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/memory-core-host-engine-embeddings-BDFBUqKJ.js

Environment

  • OpenClaw: 2026.4.27 (cbc2ba0)
  • Install/runtime: npm global under nvm
  • Node: v24.13.0
  • Gateway: systemd user service
  • OS: Linux x64
  • agents.defaults.memorySearch.provider: local
  • Local model exists and is readable:
    • ~/.openclaw/models/hf_ggml-org_embeddinggemma-300M-Q8_0.gguf

Expected Behavior

When agents.defaults.memorySearch.provider = "local" and the local model path is valid, OpenClaw should either:

  • include and retain the required local memory runtime dependencies in plugin-runtime-deps, or
  • resolve the documented global installs reliably, or
  • provide a repair command that installs/pins all required local memory runtime dependencies.

openclaw memory status --deep should report:

Embeddings: ready
Vector: ready

Actual Behavior

openclaw memory status --deep and memory sync fail because the runtime cannot resolve node-llama-cpp from the managed runtime directory.

Installing globally as suggested:

does not make it resolvable from:

~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/

Installing directly inside the plugin-runtime-deps root is not stable either. OpenClaw regenerates/prunes that runtime deps tree based on .openclaw-runtime-deps.json, and packages not present in the managed specs are removed.

For example, after manually installing node-llama-cpp, it appeared in package-lock.json, but node_modules/node-llama-cpp was later absent again.

Additional Runtime Dependency Issues

After working around node-llama-cpp, openclaw memory status --deep exposed a second missing dependency:

sqlite-vec unavailable: Cannot find package 'sqlite-vec' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/engine-storage-CO3qFXo7.js

This caused:

Embeddings: ready
Vector: unavailable

There was also a memory CLI startup failure after runtime deps pruning:

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'chokidar' imported from ~/.openclaw/plugin-runtime-deps/openclaw-2026.4.27-b841095c8e0d/dist/manager-jzSMQjEt.js

Workaround Used Locally

I installed the missing packages globally under the same nvm Node installation:

npm i -g [email protected] [email protected] chokidar@^5.0.0

Then I patched the generated runtime bundle to import those global package entrypoints by absolute file:// URL:

  • dist/memory-core-host-engine-embeddings-BDFBUqKJ.js
    • node-llama-cpp -> file://.../node_modules/node-llama-cpp/dist/index.js
  • dist/engine-storage-CO3qFXo7.js
    • sqlite-vec -> file://.../node_modules/sqlite-vec/index.mjs
  • dist/manager-jzSMQjEt.js
    • chokidar -> file://.../node_modules/chokidar/index.js

After this workaround:

Embeddings: ready
Vector: ready
FTS: ready

and openclaw memory search --query openclaw --max-results 3 returned results.

Why This Looks Like a Packaging Issue

The OpenClaw code imports these packages by bare specifier from generated runtime files, but the managed plugin-runtime-deps manifest does not retain all of them. Since OpenClaw rebuilds/prunes the runtime deps tree, manual installation inside that directory is not durable.

The global install advice for node-llama-cpp also does not work in this nvm/systemd setup because bare ESM resolution from plugin-runtime-deps/.../dist does not search the nvm global package directory.

Suggested Fix

One of these would likely fix it:

  • Add node-llama-cpp, sqlite-vec, and chokidar to the appropriate managed runtime dependency specs when local memory search is enabled.
  • Make openclaw doctor --fix / openclaw memory status --fix install and retain these dependencies.
  • Resolve documented global optional dependencies explicitly, rather than relying on bare package imports from plugin-runtime-deps.
  • Update the local embeddings error message if global install is not expected to be resolvable from the managed runtime directory.

extent analysis

TL;DR

The most likely fix is to add the missing dependencies (node-llama-cpp, sqlite-vec, and chokidar) to the managed runtime dependency specs when local memory search is enabled.

Guidance

  • Verify that the missing packages are not already included in the plugin-runtime-deps manifest and that manual installation inside the directory is not a viable solution due to OpenClaw's pruning mechanism.
  • Consider using the suggested workaround of installing the missing packages globally and patching the generated runtime bundle to import the global package entrypoints.
  • Check if the openclaw doctor --fix or openclaw memory status --fix commands can be updated to install and retain the required dependencies.
  • Review the local embeddings error message to ensure it accurately reflects the expected resolution mechanism for global optional dependencies.

Example

No code snippet is provided as the issue is related to dependency management and packaging.

Notes

The suggested fix relies on modifying the managed runtime dependency specs or updating the openclaw commands to handle the missing dependencies. The workaround used locally may not be a permanent solution and may require adjustments to the plugin-runtime-deps manifest.

Recommendation

Apply the workaround of installing the missing packages globally and patching the generated runtime bundle, as it has been proven to work locally. This approach allows for a temporary solution until a more permanent fix can be implemented.

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 - ✅(Solved) Fix Local memorySearch runtime deps are not retained/resolved in plugin-runtime-deps [1 pull requests, 2 comments, 3 participants]