Skip to content

list_projects/index_status report the resident set, not the indexed set: with >6 indexed projects the LRU-evicted one reports "not indexed" (v0.9.0) #1115

Closed

Description

@thang72

Environment

  • Version: codebase-memory-mcp 0.9.0 (installed via install.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:

Reproduction

7 projects indexed. Within a single running server session:

  1. list_projects → returns 6 projects including -go (30,741 nodes) but omitting -frontend.
  2. index_status({project:"-go"}) → ❌ "project not found or not indexed", whose available_projects (count: 6) lists -frontend but omits -go. (list_projects and index_status disagree in the same instant.)
  3. index_status({project:"-frontend"}) → ✅ status: ready, 62,546 nodes.
  4. Now issue a few search_graph / get_code_snippet calls against -go. These succeed (the graph lazy-loads on demand).
  5. Re-run index_status({project:"-go"}) → ✅ now ready, 30,741 nodes — it resolves now that it's resident.
  6. Re-run index_status({project:"-frontend"}) → ❌ now "project not found or not indexed" — -frontend was evicted by loading -go.

The resolvable set is a sliding window of ~6; the 7th (LRU) is always reported "not indexed."

Expected

  • list_projects and index_status report 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_status enumerate the indexed set (open the .db registry) 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 spurious index_repository.

Activity

  1. added
    bugSomething isn't working
    editor/integrationEditor compatibility and CLI integration
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    and removed
    parsing/qualityGraph extraction bugs, false positives, missing edges
    on Jul 16, 2026
  2. added this to the 0.9.1-rc milestone on Jul 16, 2026
  3. DeusData commented on Jul 16, 2026

    @DeusData
    Owner

    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.

  4. DeusData commented on Sep 26, 2026

    @DeusData
    Owner

    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_projects listed all 11 and index_status resolved every one, across repeated rounds interleaved with queries. Could you confirm on v0.11.0 with your 7-project monorepo?

  5. added
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Sep 26, 2026
  6. github-actions commented on Sep 26, 2026

    @github-actions

    Thanks for the report! To move this forward we need a bit more so we can reproduce it ourselves:

    • the codebase-memory-mcp --version you're on
    • the exact steps or command you ran
    • a public repo (or a small dummy snippet) that shows the problem — please don't paste proprietary code

    Once that's here we'll pick it straight back up. Heads-up: issues left awaiting-reporter are automatically closed after a few weeks of silence, but a comment reopens the door anytime.

  7. github-actions commented on Oct 19, 2026

    @github-actions

    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.

  8. added
    staleNo activity after an info request; will be closed soon
    on Oct 19, 2026
  9. added 2 commits that reference this issue on Oct 20, 2026
  10. DeusData commented on Oct 25, 2026

    @DeusData
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then closebugSomething isn't workingeditor/integrationEditor compatibility and CLI integrationpriority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.staleNo activity after an info request; will be closed soonux/behaviorDisplay bugs, docs, adoption UX

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions