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

Open
#48 0 comments 0 reactions 1 assignee View on GitHub

@Elizaveta239 is already working on this.

Since Oct 13, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
git
Domain
devtools

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Shell
Stars
38
Forks
4
Avg merge
5h 26m
Merged PRs (30d)
5

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JetBrains/context

All issues in JetBrains/context

Similar issues

More Shell/Bash issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.