search_code (and detect_changes): rejects projects indexed by index_repository when root_path contains '$'
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 70/100
Piste de recherche
Start with validate_search_path_arg and validate_search_args at the cited locations in src/mcp/mcp.c, then inspect the detect_changes validation around lines 20275–20287. Trace how root_path reaches these checks and how paths are passed to search. Reproduce using a repository path containing $; done means search_code finds the match and detect_changes accepts the indexed path, or indexing clearly rejects it upfront.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Version
codebase-memory-mcp 0.12.1 (built from source at 9a4da7a3; also verified unchanged on main d5e39e5a, src/mcp/mcp.c:17466-17514, 18244, 20275-20287)
Platform
Linux (x64)
Install channel
Built from source
Binary variant
standard
What happened, and what did you expect?
index_repository succeeds on a valid repository path containing $ (e.g., /tmp/repo$cash), persists its root_path, and list_projects returns the indexed project normally.
However, calling search_code on that indexed project with only {"project": "dollar_repo", "pattern": "hello"} (without passing file_pattern or path_filter) immediately fails with:
path or file_pattern contains invalid characters
Root cause: validate_search_args(root_path, file_pattern) (src/mcp/mcp.c:17506-17514) runs validate_search_path_arg (mcp.c:17466-17481) on the persisted root_path, which still rejects $ (as well as ;, |, ", etc., whereas #272 relaxed & because POSIX single-quoting neutralizes shell metacharacters). The same check also rejects root_path in detect_changes (mcp.c:20275-20287).
Expected: either search_code / detect_changes safely handle valid POSIX/Windows paths containing $ (since POSIX single-quoting already neutralizes $, or by avoiding shell interpolation via argv), or index_repository rejects/warns upfront instead of indexing a project whose search_code calls always fail with a misleading "path or file_pattern contains invalid characters" message even when the caller passed neither path nor file_pattern.
Reproduction
- Code: create a minimal dummy repo in a directory whose name contains
$:mkdir -p '/tmp/repo$cash' printf 'def hello():\n return "hello"\n' > '/tmp/repo$cash/main.py' - MCP calls:
- Step 1 —
index_repository:
Output: succeeds ({"repo_path": "/tmp/repo$cash", "name": "dollar_repo", "mode": "fast"}"project": "dollar_repo","files_indexed": 1,"nodes": ...). - Step 2 —
list_projects:
Output: lists{"format": "json"}"name": "dollar_repo","root_path": "/tmp/repo$cash". - Step 3 —
search_code(nofile_patternpassed):
Actual output ({"project": "dollar_repo", "pattern": "hello"}isError: true):path or file_pattern contains invalid characters
- Step 1 —
- Expected for Step 3:
search_codereturns the match inmain.py(or, if$paths are intentionally unsupported,index_repositoryrejects them at index time and the error clearly names the projectroot_pathrather than"path or file_pattern").
Logs
Step 1 (index_repository): {"project":"dollar_repo",...,"files_indexed":4,"nodes":18,"edges":19,...}
Step 2 (list_projects): {"projects":[{"name":"dollar_repo","root_path":".../repo$cash"}],"total":1,...}
Step 3 (search_code, isError=true): path or file_pattern contains invalid characters
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.
- Langage dominant
- C
- Étoiles
- 45.8k
- Forks
- 3.8k
- Merge moyen
- 2 j 18 h
- PR mergées (30 j)
- 108
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de DeusData/codebase-memory-mcp
-
bug ux/behavior
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
DeusData/codebase-memory-mcp#3191 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation enhancement parsing/quality ux/behavior
Difficulté 1/5 1-3 heures Accessibilité débutants 82/100
DeusData/codebase-memory-mcp#3131 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
hook-augment: the five-row cap keeps the first five search_graph rows, so variables and modules displace function definitions (v0.12.1)Peut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertebug editor/integration parsing/quality ux/behavior
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
DeusData/codebase-memory-mcp#3062 · 2 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Generated client files (AGENTS.md block, SKILL.md) teach a call syntax no harness can executeOuvertebug documentation editor/integration parsing/quality
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
DeusData/codebase-memory-mcp#3050 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
editor/integration parsing/quality
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
DeusData/codebase-memory-mcp#2286 ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de DeusData/codebase-memory-mcp
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
NVIDIA/open-gpu-kernel-modules#1635 ·
Les mainteneurs répondent en général sous 1 jour
-
iOS: the "Edit controls" button never hides, even with a controller connected, and covers the gameOuvertegame: 010065A014024000 ios
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
seedds/nxnative#3714 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours