Repository navigation
Description
Summary
After each recent npm-based OpenClaw update, local memory_search stops working because the node-llama-cpp optional dependency is no longer present under the installed OpenClaw package directory.
This has happened repeatedly on the same Linux host after OpenClaw updates. The workaround is always to manually reinstall node-llama-cpp into the OpenClaw package prefix and then retest memory_search.
Environment
- OpenClaw before latest update:
2026.5.27 - OpenClaw after latest update:
2026.5.28 (e932160) - Install kind: global npm package under
/home/openclaw/.npm-global/lib/node_modules/openclaw - Node.js:
v24.15.0 - npm:
11.12.1 - Gateway: systemd user service, loopback
127.0.0.1:18789 - Memory provider: local embeddings
- Expected local model:
hf:ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf
Repro / observed flow
- Update OpenClaw via npm from
2026.5.27to2026.5.28. - Restart the gateway.
- Run a local
memory_searchtool call.
Actual result
memory_search becomes unavailable:
results: []
disabled: true
unavailable: true
error: Local embeddings unavailable.
Reason: optional dependency node-llama-cpp is missing (or failed to install).
Detail: Cannot find package 'node-llama-cpp' imported from /home/openclaw/.npm-global/lib/node_modules/openclaw/dist/embeddings-C9YA6RhB.js
npm ls -g --depth=0 node-llama-cpp openclaw only showed openclaw@2026.5.28; node-llama-cpp was absent.
A local post-update check also flagged the dependency as missing:
Memory-Search-Abhaengigkeit
[PROBLEM] node-llama-cpp fehlt im OpenClaw-Paket; memory_search danach im Chat testen/reparieren
Expected result
After an OpenClaw npm update, local memory_search should keep working without manually reinstalling node-llama-cpp into the OpenClaw package directory.
At minimum, the update flow or doctor should detect this condition and offer a direct repair step.
Workaround that fixes it
npm install --no-save node-llama-cpp@3.18.1 --prefix /home/openclaw/.npm-global/lib/node_modules/openclaw
cd /home/openclaw/.npm-global/lib/node_modules/openclaw && node -e "import('node-llama-cpp').then(()=>console.log('ok'))"After this, the same memory_search call succeeds again:
provider: local
model: hf:ggml-org/embeddinggemma-300m-qat-q8_0-GGUF/embeddinggemma-300m-qat-Q8_0.gguf
hits: 3
The post-update check then passes:
CLI version: 2026.5.28
Package version: 2026.5.28
Gateway version: 2026.5.28
node-llama-cpp present
OK: 8 | Hinweise: 0 | Probleme: 0
Why this matters
For agents configured to rely on local/free memory search, every npm update silently removes or fails to preserve the native local embeddings dependency. The gateway can otherwise look healthy, so the breakage only appears when an agent tries to recall memory.
Related context
This seems adjacent to local memory/provider work such as #70596 and #70873, but the issue here is specifically the npm update/install result: node-llama-cpp disappears from the installed OpenClaw package prefix and must be reinstalled manually after updates.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 31, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed May 31, 2026, 12:33 PM ET / 16:33 UTC.
Summary
Keep open: current main still treats node-llama-cpp as operator-installed, and the existing diagnostics do not make npm upgrades preserve or directly repair the local embeddings runtime that this report says disappears after update.
Reproducibility: yes. for the runtime failure path, but not as a live npm-upgrade repro in this read-only checkout. Current source imports node-llama-cpp for provider=local and returns the reported unavailable error when that operator-installed package is missing.
Next step
The remaining action needs maintainer choice between package policy, update/doctor repair behavior, and operator-install guidance before an automated fix PR is safe.
Review details
Best possible solution:
Add a maintainer-approved upgrade/doctor path that either preserves or reinstalls the operator-installed local embeddings runtime after npm updates, or reliably diagnoses it with an exact repair command and packaged-upgrade proof.
Do we have a high-confidence way to reproduce the issue?
Yes for the runtime failure path, but not as a live npm-upgrade repro in this read-only checkout. Current source imports node-llama-cpp for provider=local and returns the reported unavailable error when that operator-installed package is missing.
Is this the best way to solve the issue?
Unclear until maintainers choose the boundary. Current diagnostics are not enough for the reported upgrade workflow, but declaring node-llama-cpp as an OpenClaw dependency conflicts with existing release policy.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against a6ee3dbbdd07.
Label changes
Label changes:
P1: The report describes a real configured memory_search workflow becoming unavailable after every npm update for local embeddings users.impact:session-state: The failure disables memory retrieval for agents that depend on local memory_search to recall prior context.issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state selects this label.clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.clawsweeper:needs-product-decision: Current issue advisory state selects this label.Label justifications:
P1: The report describes a real configured memory_search workflow becoming unavailable after every npm update for local embeddings users.impact:session-state: The failure disables memory retrieval for agents that depend on local memory_search to recall prior context.Evidence reviewed
What I checked:
package.json:1852, a6ee3dbbdd07)test/openclaw-npm-release-check.test.ts:762, a6ee3dbbdd07)extensions/memory-core/src/memory/provider-adapters.ts:46, a6ee3dbbdd07)src/commands/doctor-memory-search.ts:471, a6ee3dbbdd07)src/commands/doctor-gateway-health.ts:102, a6ee3dbbdd07)src/gateway/server-methods/doctor.ts:923, a6ee3dbbdd07)Likely related people:
package.json,scripts/openclaw-npm-release-check.ts,extensions/memory-core/src/memory/provider-adapters.ts)src/commands/doctor-memory-search.ts)src/commands/doctor-memory-search.ts)src/commands/doctor-memory-search.ts,extensions/memory-core/src/memory/provider-adapters.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.osolmaz commentedon Jun 4, 2026
Related earlier package-policy PR: #71425 removed node-llama-cpp from OpenClaw package metadata and made the release check reject it as a direct, optional, or peer dependency.
That makes the current workaround fragile: npm treats node-llama-cpp installed inside the OpenClaw package prefix as an extra nested package, so a later npm update can remove it.
I reproduced the reported update path in AWS Crabbox: provider=aws, lease=cbx_21e58264a850, run=run_3b8c68212a9f. openclaw@2026.5.27 plus node-llama-cpp@3.18.1 imported successfully before the update; after npm install -g openclaw@2026.5.28, the OpenClaw package prefix had no node-llama-cpp and the import failed.
osolmaz commentedon Jun 5, 2026
I reproduced the package-manager behavior in a clean temp npm prefix.
Flow tested:
Observed result:
So yes: a manually installed
node-llama-cppunder the installed OpenClaw package directory is removed by the next npm update.Why: that package is being added inside npm's managed OpenClaw install tree:
When
npm install -g openclaw@<new version>runs, npm reconciles thatopenclawpackage directory to match OpenClaw's package metadata. Sincenode-llama-cppis not listed in OpenClaw'sdependenciesoroptionalDependencies, and the manual install used--no-save, npm treats it as an extraneous nested package and prunes it.Installing
node-llama-cppsomewhere else outside the OpenClaw installation is not a reliable workaround either. The current runtime importsnode-llama-cppfrom OpenClaw's runtime files, so Node resolves it relative to the OpenClaw package tree unless the code is changed to load from an explicit external path.Practical fix directions:
node-llama-cppan actual OpenClaw dependency or optional dependency, so npm owns and preserves it.node-llama-cppas its dependency.The current documented/manual workaround works only until the next npm update.