Skip to content

bug: MCP search returns internal error after lock -- possible cold-start race #22

@robotrocketscience

Description

@robotrocketscience

Bug

Immediately after running agentmemory lock via CLI, two consecutive mcp__agentmemory__search calls returned [Tool result missing due to internal error]. A subsequent mcp__agentmemory__status call succeeded, and search calls after that also succeeded.

Reproduction

  1. Lock a new belief: uv run agentmemory lock "some text"
  2. Immediately call mcp__agentmemory__search via MCP
  3. First 1-2 calls may fail with internal error
  4. Subsequent calls succeed

Hypothesis

Possible causes:

  • WAL checkpoint race: CLI lock writes to DB, MCP server reads stale WAL state
  • Connection pool: MCP server connection doesn't see new data until next checkpoint
  • Transient: may be unrelated to the lock operation (network/IPC hiccup)

Evidence

Only 2 data points (single occurrence). Could be transient. Filing to track in case it recurs.

Impact

Low -- workaround is to retry. But if this happens during hook injection, beliefs could be silently missed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions