Repository navigation
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
On Ubuntu 24.04 with Node v22.22.2, the sqlite-vec extension fails to load during gateway runtime, resulting in "Vector store: unknown" and memory_search returning 0 hits.
Steps to reproduce
- Install OpenClaw 2026.5.28 on Ubuntu 24.04.4 LTS (Proxmox VM) with Node.js v22.22.2
- Configure memorySearch with any embedding provider (e.g., DashScope text-embedding-v4)
- Run openclaw memory status → "Vector store: unknown"
- Memory index completes (645 chunks), but memory_search returns 0 hits
Expected behavior
The sqlite-vec extension loads successfully during gateway runtime, "Vector store" shows "sqlite-vec" as the vector backend, and memory_search returns vector similarity results matching the stored embeddings.
Actual behavior
"Vector store: unknown" for all agents despite sqlite-vec v0.1.9 (linux-x64 vec0.so) present. memory_search returns 0 hits. vec0.so binary is valid (ldd passes). Setting store.vector.extensionPath does NOT fix the issue.
OpenClaw version
OpenClaw version: 2026.5.28 (e932160)
Operating system
Ubuntu 24.04.4 LTS, Linux 7.0.2-7-pve, x86_64
Install method
npm global
Model
Qwen3.6-27B
Provider / routing chain
Default config → dashscope (Alibaba/text-embedding-v4) via dashscope.aliyuncs.com Note: embedding API works fine (DashScope returns vectors); the failure is in local sqlite-vec extension loading
Additional provider/model setup details
No response
Logs, screenshots, and evidence
Key diagnostic: vec0.so loads fine in Node 22's node:sqlite manually:
const { DatabaseSync } = require('node:sqlite');
const db = new DatabaseSync(':memory:', { allowExtension: true });
db.loadExtension('/path/to/vec0.so'); // WORKS ✅
Root cause appears in loadSqliteVecExtension() ESM import fallback chain in bundled runtime.
This is NOT the same as #64776 (macOS, CLI worked) or #65033 (Node 24 specific).Impact and severity
No response
Additional information
No response
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, 8:41 AM ET / 12:41 UTC.
Summary
Keep open: current main still routes built-in memory through the same sqlite-vec loader surface, and I found no merged fix or shipped release that resolves the reported Node 22 Linux x64 failure. The exact failure mode needs a live Ubuntu/Node 22 repro because ordinary
memory statuscan showunknownuntil a deep vector probe runs.Reproducibility: no. high-confidence current-main repro yet. The report has concrete Ubuntu/Node 22 steps and current source still has the implicated loader path, but I did not run that live environment and plain
memory statuscan showunknownuntil--deepprobes the vector store.Ways to help us reproduce this
Next step
Needs maintainer or live-repro review before a repair lane because the likely root cause is not yet separated from adjacent sqlite-vec Linux, dependency ABI, provider, and status-probe failure modes.
Review details
Best possible solution:
Confirm the Ubuntu Node 22 packaged-runtime failure with
memory status --deepand a gatewaymemory_search, then fix the memory-host-sdk sqlite-vec load or packaging path with focused regression coverage and clear diagnostics.Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main repro yet. The report has concrete Ubuntu/Node 22 steps and current source still has the implicated loader path, but I did not run that live environment and plain
memory statuscan showunknownuntil--deepprobes the vector store.Is this the best way to solve the issue?
Unclear. A memory-host-sdk sqlite-vec loader or package-resolution fix is plausible, but the safest path is to first capture the actual load error and distinguish import fallback, platform package, ABI, and provider/status-probe causes.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
extensionPathfailure conflicts with a pure ESM import-fallback diagnosis, so changing the loader without the actualVector erroror a live repro could fix the wrong failure class.Codex review notes: model gpt-5.5, reasoning high; reviewed against fd88f34a8fb7.
Label changes
Label changes:
P2: This is a normal-priority memory vector recall bug with limited blast radius: semantic memory search degrades, but the core runtime is not reported unusable.impact:session-state: The reported failure affects indexed memory/vector recall state and can make agent memory searches return no semantic hits.issue-rating: 🦐 gold shrimp: Current issue advisory state selects this label.clawsweeper:needs-info: 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.Label justifications:
P2: This is a normal-priority memory vector recall bug with limited blast radius: semantic memory search degrades, but the core runtime is not reported unusable.impact:session-state: The reported failure affects indexed memory/vector recall state and can make agent memory searches return no semantic hits.Evidence reviewed
Acceptance criteria:
openclaw memory status --deep --agent <agent>and recordVector store,Vector error,Embeddings, andSemantic vectorswith private paths/secrets redacted.openclaw memory index --force --agent <agent>and a gatewaymemory_searchquery against known indexed text to prove before/after behavior.node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/sqlite-vec.test.ts extensions/memory-core/src/memory/manager-search.test.tsor a narrower equivalent focused on the changed files.What I checked:
memory_searchreturns 0 hits.extensionPath, then importssqlite-vecand only falls back to the platform package when the meta package is missing. (packages/memory-host-sdk/src/host/sqlite-vec.ts:30, fd88f34a8fb7)linux-x64tosqlite-vec-linux-x64/vec0.so, matching the reporter's platform and package evidence. (packages/memory-host-sdk/src/host/sqlite-vec-platform-variant.ts:5, fd88f34a8fb7)falsefrom vector readiness; chunk writes only updatechunks_vecwhenvectorReadyis true, so this path can explain degraded semantic recall. (extensions/memory-core/src/memory/manager-sync-ops.ts:274, fd88f34a8fb7)ensureVectorReadyfrom a sample embedding and only writeschunks_vecrows when that check succeeds; otherwise it emits the degraded vector warning. (extensions/memory-core/src/memory/manager-embedding-ops.ts:719, fd88f34a8fb7)memory status --deepprobes vector-store availability; plain status can format an unprobed built-in vector store asunknown, so the status line alone does not prove sqlite-vec failed. (extensions/memory-core/src/cli.runtime.ts:687, fd88f34a8fb7)Likely related people:
extensions/memory-core/src/memory/manager-sync-ops.ts,packages/memory-host-sdk/src/host/sqlite-vec.ts,packages/memory-host-sdk/src/host/sqlite-vec-platform-variant.ts)packages/memory-host-sdk/src/host/sqlite-vec.ts,extensions/memory-core/src/memory/manager-sync-ops.ts,extensions/memory-core/src/cli.runtime.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.Joelincn commentedon Jun 2, 2026
Update: SQLite ABI version mismatch confirmed
After further investigation, I found the root cause:
System SQLite version (via node:sqlite): 3.51.2 (Node v22.22.2)
sqlite-vec precompiled binary: 0.1.9 (compiled for SQLite 3.45.x)
Key findings
The
vec0.sobinary loads correctly when tested manually with node:sqlite:However, OpenClaw's own loadSqliteVecExtension() in the bundled ESM runtime fails to load it during initial startup, resulting in "Vector store: unknown".
This issue is related to the better-sqlite3 ABI mismatch ([Bug] Memory vector search broken in v4.11 — sqlite-vec loads but registers no functions (SQLite ABI mismatch) #65156) but in a DIFFERENT failure mode. Here, OpenClaw uses node:sqlite (not better-sqlite3), and the precompiled vec0.so (SQLite 3.45.x ABI) is incompatible with Node 22's built-in SQLite 3.51.2.
memory status --deep before the fix showed:
Current status: PARTIALLY RESOLVED ✅
After running
openclaw update(from 2026.5.27 to 2026.5.28) and a subsequent gateway restart, the issue appears to have resolved itself:It seems that a later restart eventually succeeded where earlier ones failed. This suggests the issue is a startup timing or retry race condition.
Root cause summary
Joelincn commentedon Jun 2, 2026
Code-level root cause pinpointed
I traced the exact failure path in
loadSqliteVecExtensioninengine-storage-Dkl2KcXA.js.The bug
params.extensionPathis set → directly loads .so → worksimport("sqlite-vec")→ fails with error type NOT matchingisMissingSqliteVecPackageError→ rethrows{ ok: false }→ fallback toresolveSqliteVecPlatformVariantnever executesisMissingSqliteVecPackageErroronly matchesERR_MODULE_NOT_FOUND/MODULE_NOT_FOUND. The bundled ESM runtime throws a different error type on Node 22/Linux.Config-level fix (confirmed working)
Setting
extensionPathbypasses the broken ESM import:Result:
Vector store: readyon every restart,memory_searchreturns proper results with vectorScore.Suggested code fix
The
isMissingSqliteVecPackageErrorcheck should be removed or made non-fatal. When ESM import fails (any error type), it should always fall through toresolveSqliteVecPlatformVariant():Or simply try
resolveSqliteVecPlatformVariantbefore the ESM import so the native .so is always attempted first.vincentkoc commentedon Jun 8, 2026
Fixed on main in 355a9cb.
What changed:
loadSqliteVecExtensionstill prefers a configuredstore.vector.extensionPathwhen one is set.sqlite-vecpackage import/load path fails, OpenClaw now attempts the resolved platform-specific native extension before giving up.SELECT vec_version() AS version, so a broken native load is not treated as ready.extensionPathhint.Proof run after the patch:
node scripts/run-vitest.mjs packages/memory-host-sdk/src/host/sqlite-vec.test.ts— 9 tests passed.node scripts/sqlite-vec-smoke.mjs— loaded sqlite-vec and queried a vec0 table successfully.node scripts/run-oxlint.mjs packages/memory-host-sdk/src/host/sqlite-vec.ts packages/memory-host-sdk/src/host/sqlite-vec.test.ts— clean.git diff --check— clean.