Bug Report
Version: OpenClaw 2026.6.1 (2e08f0f)
OS: macOS 15.4.0 (arm64, M4 Mac Mini)
Summary
The gateway's memory auto-sync creates a dead loop: it indexes files (creating chunks) but never writes the meta table entry (memory_index_meta_v1), so indexIdentityState remains "missing" forever. All memory_search calls return "index metadata is missing" with 0 results.
Root Cause (from source analysis)
In manager-dZw31DAG2.js, the runSync() method at ~line 2073:
if (indexIdentity.status !== "valid" && !needsFullReindex) {
this.dirty = true;
// ... mark sessions dirty
return; // ← Returns without writing meta!
}
The condition needsFullReindex is false when hasIndexedChunks is true (which it is, because the sync itself just created chunks). So after the first sync cycle:
- Identity is "missing" (no meta)
hasIndexedChunks = true (sync created chunks)
needsInitialIndex = false (has chunks)
needsExplicitIdentityReindex = false (not CLI-triggered)
- Early return without writing meta
- Next sync → same loop
Reproduction
- Start with an empty
meta table in omes-vec.db (e.g., after DB corruption or version upgrade)
openclaw gateway start
- Gateway auto-sync runs, indexes files, creates chunks
memory_search returns "index metadata is missing"
- Running
openclaw memory index --force from CLI writes meta correctly
- But gateway restart clears meta again (gateway re-syncs from scratch)
Workaround Attempted
openclaw gateway stop → clear DB → openclaw memory index --force → openclaw gateway start
- Gateway starts, sees existing chunks, but still enters the dead loop because its sync finds identity "missing" and hasIndexedChunks=true
Environment
- Embedding provider:
openai-compatible (local oMLX on localhost:8000, model bge-m3-mlx-fp16)
- DB:
~/.openclaw/memory/omes-vec.db (SQLite with sqlite-vec)
- Extra paths: 4 external directories (~1200 files total)
- 6 agents configured, all show
providerState: pending after gateway starts
Expected Behavior
When gateway auto-sync encounters identity "missing" but has indexed chunks (from its own sync or CLI), it should either:
- Write meta after completing the sync (even if identity is still "missing"), OR
- Treat "identity missing + has chunks from current sync" as
needsInitialIndex = true
Bug Report
Version: OpenClaw 2026.6.1 (2e08f0f)
OS: macOS 15.4.0 (arm64, M4 Mac Mini)
Summary
The gateway's memory auto-sync creates a dead loop: it indexes files (creating chunks) but never writes the
metatable entry (memory_index_meta_v1), soindexIdentityStateremains "missing" forever. Allmemory_searchcalls return"index metadata is missing"with 0 results.Root Cause (from source analysis)
In
manager-dZw31DAG2.js, therunSync()method at ~line 2073:The condition
needsFullReindexisfalsewhenhasIndexedChunksis true (which it is, because the sync itself just created chunks). So after the first sync cycle:hasIndexedChunks= true (sync created chunks)needsInitialIndex= false (has chunks)needsExplicitIdentityReindex= false (not CLI-triggered)Reproduction
metatable inomes-vec.db(e.g., after DB corruption or version upgrade)openclaw gateway startmemory_searchreturns"index metadata is missing"openclaw memory index --forcefrom CLI writes meta correctlyWorkaround Attempted
openclaw gateway stop→ clear DB →openclaw memory index --force→openclaw gateway startEnvironment
openai-compatible(local oMLX on localhost:8000, modelbge-m3-mlx-fp16)~/.openclaw/memory/omes-vec.db(SQLite with sqlite-vec)providerState: pendingafter gateway startsExpected Behavior
When gateway auto-sync encounters identity "missing" but has indexed chunks (from its own sync or CLI), it should either:
needsInitialIndex = true