Repository navigation
Description
Environment
- Version:
codebase-memory-mcp 0.9.0(installed viainstall.sh --ui,~/.local/bin/codebase-memory-mcp) - Platform: macOS 24.6.0 (Darwin) arm64
- Setup: a monorepo whose root and 7 sub-repos are each indexed as a separate project (parent +
-go,-frontend,-backend,-content,-config,-ssc-content-plugin). Driven over stdio MCP from an agent host (no CLI restarts between calls).
Summary
With 7 indexed projects but only ~6 resolvable at any instant, the least-recently-used project reports "project not found or not indexed" on index_status / search_graph / detect_changes — even though it is fully indexed and, once touched, queryable. Querying one heavy project evicts another, so which 6 resolve flips over the course of a session. list_projects and index_status report different sets in the same instant, and neither reports the true indexed set.
This looks like a bounded resident/store pool (~6) with LRU-style eviction, where the discovery endpoints report the resident set rather than the indexed set. It is distinct from:
- index_status returns project-not-found for project returned by list_projects #349 (closed) — that was a name-sanitization mismatch in
resolve_store/cbm_validate_project_name; my project names are all[A-Za-z0-9-], so that path passes. This is dynamic, not a fixed per-name rejection. - Project remains listed but becomes unqueryable after MCP restart with stale WAL/SHM sidecars #790 (open) — that requires an MCP restart + stale WAL/SHM sidecars; no restart is involved here — eviction happens live within one running server as different projects are queried.
Reproduction
7 projects indexed. Within a single running server session:
list_projects→ returns 6 projects including-go(30,741 nodes) but omitting-frontend.index_status({project:"-go"})→ ❌"project not found or not indexed", whoseavailable_projects(count: 6) lists-frontendbut omits-go. (list_projects and index_status disagree in the same instant.)index_status({project:"-frontend"})→ ✅status: ready, 62,546 nodes.- Now issue a few
search_graph/get_code_snippetcalls against-go. These succeed (the graph lazy-loads on demand). - Re-run
index_status({project:"-go"})→ ✅ nowready, 30,741 nodes — it resolves now that it's resident. - Re-run
index_status({project:"-frontend"})→ ❌ now"project not found or not indexed"—-frontendwas evicted by loading-go.
The resolvable set is a sliding window of ~6; the 7th (LRU) is always reported "not indexed."
Expected
list_projectsandindex_statusreport the full set of indexed projects, regardless of which graphs are currently resident.- A project that is indexed-but-evicted is not reported as
"project not found or not indexed"— either resolve it transparently (as the query tools already do via lazy-load), or return a distinct status (e.g.not_resident/will_load_on_query) so callers don't conflate it with genuinely-unindexed code.
Impact
The query tools themselves are excellent and lazy-load fine — but agents are told (by the standard workflow / hooks) to verify with list_projects / index_status first, and run index_repository if "not indexed." Because those endpoints intermittently report the biggest, most-used graphs (-go, -frontend) as "not indexed," agents either (a) fall back to grep, or (b) needlessly re-index (which no-ops on unchanged HEAD SHA). This is a concrete driver of #509 ("AI not using the MCP as much as it should"): the discovery layer, not the data, is what makes agents give up.
Suggested fix direction
- Make
list_projects/index_statusenumerate the indexed set (open the.dbregistry) independent of the resident/LRU pool — the same source both endpoints should agree on. - Raise the resident-pool cap to at least the number of indexed projects (or make it configurable), and/or evict lazily so a query always transparently loads its target.
- Distinguish
"evicted / not resident"from"not indexed"in the error, so automation doesn't trigger a spuriousindex_repository.
Activity
DeusData commentedon Jul 16, 2026
Thanks for the unusually clear same-session eviction sequence. This is a high-priority 0.9.1-rc discovery correctness bug because the prescribed MCP workflow can misclassify an indexed project and trigger unnecessary reindexing or grep fallback. The RED regression should create more projects than the resident-store capacity, force eviction, and prove that list_projects, index_status, and a query agree on the full indexed set without raising the resident cap as the primary fix.
DeusData commentedon Sep 26, 2026
Thank you, @thang72, for the clear same-session eviction sequence! We couldn't reproduce it on current main. In one long-lived session with 11 indexed projects,
list_projectslisted all 11 andindex_statusresolved every one, across repeated rounds interleaved with queries. Could you confirm on v0.11.0 with your 7-project monorepo?github-actions commentedon Sep 26, 2026
Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:
codebase-memory-mcp --versionyou're onOnce that's here we'll pick it straight back up. Heads-up: issues left
awaiting-reporterare automatically closed after a few weeks of silence, but a comment reopens the door anytime.github-actions commentedon Oct 19, 2026
This issue has been waiting on more information for 21 days (a version, exact steps, or a public repro), so it's now marked
stale. It will not be closed automatically — a maintainer reviews stale issues by hand. Adding a comment with the details clears the label and puts it straight back in the queue. We're happy to pick it back up the moment we can reproduce it.test(mcp): give the DeusData#1115 store-switch coverage its own test
Merge pull request #2508 from lorenzozanee/fix/issue-1115-indexed-pro…
DeusData commentedon Oct 25, 2026
Thank you, @thang72, for the very precise same-session eviction sequence -- it gave us the exact shape for a regression test. We still cannot reproduce this on current main, and #2508 (merged in b870019) now guards it: twelve indexed projects are visited one after another through index_status and search_graph, and list_projects must report all twelve before and after. That test runs on Linux, macOS and Windows in CI. Closing this as covered; if you still see an indexed project reported as "not indexed" on a current release, please reply with the version and steps and we will reopen right away.