Skip to content

list_projects hangs indefinitely with 2 indexed projects (v0.9.0, macOS arm64, cli — single-project queries unaffected) #1195

Description

@frankliu7

Environment

  • v0.9.0, darwin/arm64 (standard, non-UI variant), installed via install.sh
  • macOS on Apple silicon, 16 GB RAM
  • Invoked through cli only — the MCP server was never started, no watcher, no UI
  • Cache: ~/.cache/codebase-memory-mcp, 266 MB total

Summary

With exactly two indexed projects, list_projects blocks indefinitely and never returns. It has to be killed. Every other tool on the same cache keeps working normally, so this is specific to multi-project enumeration — not a corrupt cache and not a stuck database.

Repro

# 1. Index project A (private Python monorepo)
$ cbm cli index_repository --repo-path /path/to/A --mode full
{... "nodes":81527,"edges":301976,"status":"indexed"}          # 7.0 s

# 2. With ONE project in the cache, list_projects is instant
$ cbm cli list_projects
{"projects":[{"name":"...","nodes":81527,"edges":301976,"size_bytes":238682112}]}   # < 1 s

# 3. Index project B (a second, smaller repo)
$ cbm cli index_repository --repo-path /path/to/B --mode full
{... "nodes":14478,"edges":50848,"status":"indexed"}           # 1.3 s

# 4. With TWO projects, list_projects never returns
$ cbm cli list_projects
level=info msg=mem.init budget_mb=4096 total_ram_mb=16384
# ...hangs. Killed at 30 s, 180 s, and 335 s in three separate runs.

Reproduced 3/3 on a clean process table (all prior codebase-memory-mcp processes killed, no MCP server running).

Process state while hung

$ ps -eo pid,etime,%cpu,%mem,command | grep codebase-memory
 1563  05:35   0.0  0.0 codebase-memory-mcp cli list_projects
 2083  03:11   0.0  0.0 codebase-memory-mcp cli list_projects

0.0% CPU — blocked, not spinning. No log output beyond the mem.init line; ~/.cache/codebase-memory-mcp/logs/ stays empty.

Cache state (both DBs healthy)

40,501,248   <B>.db          32,768  <B>.db-shm          0  <B>.db-wal
238,682,112  <A>.db          32,768  <A>.db-shm          0  <A>.db-wal

Key discriminator — single-project access is unaffected

Immediately after killing the hung list_projects, both projects query fine:

$ cbm cli search_graph --project <A> --query "..." --limit 2     # rc=0, 44 ms
$ cbm cli search_graph --project <B> --query "..." --limit 2     # rc=0, 13 ms

So each database opens, reads and returns normally in isolation. Only the call that enumerates both hangs.

Impact

list_projects is the discovery entry point — the tool description for index_status explicitly tells callers to "Run list_projects to see indexed projects". Once a second project exists, an agent following that guidance blocks forever rather than getting an error, and there is no timeout or partial result to fall back on.

Relationship to existing issues (checked before filing; none appear to cover this)

Happy to gather anything further (sampled stack via sample, fs_usage, a CBM_CACHE_DIR-isolated two-project repro on public repos) if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.stability/performanceServer crashes, OOM, hangs, high CPU/memoryux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions