Skip to content

agentmemory__memory_search returns "index metadata is missing" persistently (memory-core manager state cache) #90414

Description

@AS76

Bug: agentmemory__memory_search returns "index metadata is missing" persistently

Environment

  • OpenClaw: 2026.6.1 (latest, confirmed via npm view openclaw version)
  • Platform: Linux x64, Node v22.22.2
  • Plugin: agentmemory 0.9.4 (extension) + @agentmemory/mcp 0.9.26 + @agentmemory/agentmemory 0.9.26
  • Discovered: 2026-06-04

Summary

The runtime tool agentmemory__memory_search consistently returns the error "index metadata is missing" with the action hint "Tell the user to run: openclaw memory status --index or openclaw memory index --force" — even when the underlying infrastructure is healthy.

Reproduction

  1. Fresh install / any state where ~/.openclaw/memory/{agent}.sqlite has empty meta table on gateway startup
  2. Run openclaw memory index --force to reindex all 12 agents (meta table populated, all 12 agents have 1 row with correct model: voyage-4-large, provider: voyage)
  3. Run openclaw memory search "anything" --agent cleo from CLI → works, returns results or "no matches"
  4. Call memory_search tool from agent runtime → returns "index metadata is missing"
  5. Try kill -USR1 <gateway_pid> → tool still returns same error
  6. Try systemctl --user restart openclaw-gateway → tool still returns same error after gateway comes back
  7. npm update -g openclaw (no version change, but 285 deps updated) → tool still broken

Expected

Tool should use the live DB state and return results once meta table is populated.

Actual

Tool returns {"error":"index metadata is missing","action":"Tell the user to run: openclaw memory status --index or openclaw memory index --force."} consistently.

Technical investigation

  • Error originates in /usr/lib/node_modules/openclaw/dist/manager-dZw31DAG2.js (memory-core manager)
  • Code path: resolveMemoryIndexIdentityState({meta, provider, providerKey, ...}) returns {status:"missing", reason:"index metadata is missing"} when meta is null
  • Manager sets this.indexIdentityState ONCE at construction; subsequent reindex doesn't refresh it
  • SIGUSR1 restart signal does NOT trigger a re-read of the index identity state
  • indexIdentityState is consulted at search time, so search returns the stale "missing" status

What works (workaround)

  • CLI openclaw memory search (uses fresh DB read each time)
  • memory_get tool (file-based, not index-based)
  • REST API: POST http://localhost:3111/agentmemory/search (direct, bypasses manager)

What doesn't work

  • agentmemory__memory_search tool from any agent runtime
  • All reindex attempts
  • All restart attempts (SIGUSR1, SIGTERM, systemctl, kill -9 + systemd auto-restart)
  • npm update (already at latest)

Suggestion

Two possible fixes:

  1. In manager-dZw31DAG2.js, add a periodic revalidation of indexIdentityState against the live DB (e.g., on each search, or every N minutes)
  2. Make updateIndexIdentityState callable from CLI/external trigger

Impact

Medium. The workaround is functional but the tool exposed to agents is essentially dead for search, requiring workaround via curl in shell commands. Multi-agent setups that rely on the search tool are affected.

Workaround (for users hitting this)

Documented at /root/.openclaw/workspace/main/runbooks/memory-search-workaround.md. Use memory_get for file reads and curl to REST API for semantic search.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions