code_search (MCP): absolute pathFilter to another indexed checkout is silently ignored and returns results from the root repository

Aperta
#48 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@Elizaveta239 ci sta già lavorando.

Dal 13/10/2026.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
25/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
git
Ambito
devtools

Direzione di ricerca

Start with the MCP code_search handler and how it resolves pathFilter in --multi-repo mode, and check whether the absolute path is matched against indexed repositories at all. Reproduce with two indexed sibling checkouts, one as the MCP root and one as the filter target, then compare with jbcontext search --project-path. Done means an absolute pathFilter returns results from the named repository or fails with an explicit error, and the storage-mode lookup is confirmed correct.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Version: jbcontext 0.9.15 (build 969, commit b319f597b7, channel stable), Linux

Steps to reproduce

  1. Repo A and repo B are sibling checkouts (~/git/repo-a, ~/git/repo-b), both indexed.
  2. Start jbcontext mcp --multi-repo with the MCP root set to repo A (this is what happens when an agent session is started inside repo A).
  3. Call code_search with pathFilter set to the absolute path of repo B.

Expected

Results from repo B. The tool description in --multi-repo mode says:

A pathFilter naming a checkout under the workspace root (or any absolute path) scopes the search to the local repositories it covers

Actual

Results come from repo A, with no error or warning. An agent reading the output has no way to tell the filter was ignored and takes the results as coming from repo B.

Variants:

  • If repo A has no index, the same call fails with Error: No index found for repository '<repo A>'., even though the filter points at repo B, which is indexed.
  • A relative pathFilter of ../repo-b returns no results.
  • Same behavior without --multi-repo.

What does work

  • --multi-repo with the MCP root set to the parent directory that contains both checkouts, using pathFilter=repo-b or the absolute path.
  • The CLI from inside repo A: jbcontext search --project-path ~/git/repo-b "<query>".

Possibly related

jbcontext mcp --git-remote-url <repo B url> started from repo A returns No index found for repository '<repo B id>' (tried ssh and https URLs), although jbcontext status inside repo B lists indices. In my setup repo B's index is in remote storage and repo A's is local, in case the storage mode is being taken from the working directory.

Feature request

An explicit repository / project-path parameter on code_search (like --project-path on the CLI), so an agent started inside one repository can search another indexed checkout. Failing that, an error when pathFilter resolves outside the repositories being searched would avoid the silent wrong-repo results.

Lingua principale
Shell
Stelle
38
Fork
4
Merge medio
5h 26m
PR unite (30g)
5

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di JetBrains/context

Tutte le issue di JetBrains/context

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.