Skip to content

index_repository --name is silently ignored when the repo sits outside the server's allowed root — project gets a path-derived name #1317

Open

Description

@xantorres

Version

0.9.0

Platform

macOS (Apple Silicon) — macOS 25.5.0, darwin-arm64

Install channel

GitHub release archive

Binary variant

standard

What happened, and what did you expect?

The MCP server is configured with CBM_ALLOWED_ROOT=/Users/xtorres/projects. Indexing a repo outside that root, with the env var overridden per-command, succeeds — but --name is discarded and the project is registered under a slugified absolute path instead.

$ CBM_ALLOWED_ROOT=/Users/xtorres codebase-memory-mcp cli index_repository \
    --repo-path /Users/xtorres/dev/orkestra --name orkestra
{"nodes":5324,"edges":12841,"status":"indexed"}

$ codebase-memory-mcp cli index_status --project orkestra
# -> reports not indexed

$ ls ~/.cache/codebase-memory-mcp/
Users-xtorres-dev-orkestra.db      # <- not orkestra.db

Repos inside the allowed root honour --name correctly, so this appears specific to the outside-root path.

Persistence: survives a full delete_project + fresh index with --name orkestra, and also survives re-running with CBM_ALLOWED_ROOT=/Users/xtorres/dev (a root that does contain the repo). The derived name is sticky.

Why it matters: no error, no warning. The obvious follow-up call — index_status --project orkestra — reports the project as not indexed, which reads as a failed or lost index rather than a renamed one. An agent driving this over MCP has no way to learn the real name except by listing the cache directory or calling list_projects (which has its own hang, #1195).

Expected: either honour --name regardless of root, or fail loudly with the reason and the name that will actually be used.

Reproduction

  1. Set CBM_ALLOWED_ROOT to some directory A.
  2. cli index_repository --repo-path <repo outside A> --name shortname, overriding CBM_ALLOWED_ROOT on the command so the path is permitted.
  3. cli index_status --project shortname → reports not indexed.
  4. ls $CBM_CACHE_DIR → the db is named after the slugified absolute path.

Confirmations

  • I searched existing issues and this is not a duplicate.
  • My reproduction uses shareable code (a dummy snippet or a public OSS repository), not proprietary code.

Activity

  1. added
    bugSomething isn't working
    priority/highNeeds near-term maintainer attention; high-impact bug, regression, safety issue, or release blocker.
    on Jul 28, 2026
  2. added this to the 0.9.1-rc milestone on Jul 28, 2026
  3. DeusData commented on Jul 28, 2026

    @DeusData
    Owner

    Thanks for the precise allowed-root reproduction and for calling out the sticky-name behavior.

    I checked current main at 0802689. handle_index_repository reads name before the root check (src/mcp/mcp.c:7575-7606), preserves it in the supervised request, and applies it to the pipeline at src/mcp/mcp.c:7714-7725. There is also supervised-name regression coverage from 6908ea5, but that test uses a virgin cache and does not cover the existing path-derived database plus changed allowed-root sequence reported here.

    That leaves a real uncovered state transition rather than a generic “name is unsupported” case. I have routed this to 0.9.1-rc at priority/high. The delete/re-index persistence detail is especially useful; thank you.

  4. added
    editor/integrationEditor compatibility and CLI integration
    ux/behaviorDisplay bugs, docs, adoption UX
    and removed
    parsing/qualityGraph extraction bugs, false positives, missing edges
    on Aug 3, 2026
  5. DeusData commented on Sep 26, 2026

    @DeusData
    Owner

    Thank you for the precise allowed-root sequence, including the way the path-derived name kept coming back!

    We re-ran it on current main. A repo first indexed under its path-derived name and then re-indexed with --name orkestra comes out as orkestra every time. That held inside and outside a narrower CBM_ALLOWED_ROOT and after delete_project, and index_status --project orkestra finds it.

    Could you confirm on v0.11.0? If you still get the path-derived name, please send the exact commands, your CBM_ALLOWED_ROOT values and the resulting cache listing.

  6. added
    awaiting-reporterWaiting on the reporter for info/repro; stale bot will warn then close
    on Sep 26, 2026
  7. 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.

  8. DeusData commented on Oct 19, 2026

    @DeusData
    Owner

    Thank you again for the allowed-root/name sequence. The last response reported the maintainer retest and asked whether your v0.11.0 run still returns the derived name. That environment-specific confirmation is still outstanding; I have no new outcome to add.

  9. DeusData commented on Oct 25, 2026

    @DeusData
    Owner

    Thank you again for the naming sequence. Could you confirm whether the requested newer-version run still returns the derived name? If it does, the exact commands and allowed-root values will distinguish your case.

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.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