grep tool passes empty file type to ripgrep
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 68/100
Piste de recherche
Commencez par l’implémentation de l’outil grep intégré et le point d’entrée qui construit ses arguments ripgrep. Reproduisez le problème avec un glob et un type non défini, puis vérifiez qu’aucun type vide n’est transmis et que les type non pris en charge reçoivent une erreur claire. Exécutez les tests existants de l’outil grep, s’il y en a, et ajoutez une couverture pour les deux cas.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I asked Command Code to search my project log files for errors using its built-in search tools. Command Code invoked its grep tool, but the search failed before it searched anything.
What I expected
When I ask Command Code to search matching log files with a pattern such as:
- Glob:
**/*.log - Pattern:
error|exception|failed|failure|fatal|critical|warning|stack trace|traceback
I expect Command Code's search tool to search the matching files. If no file type is selected, the tool should search based on the glob alone.
What happened
Command Code's grep tool returned:
grep: rg: unrecognized file type:
This indicates that the tool is passing an empty type value to ripgrep, effectively invoking something like:
rg --type '' ...
Command Code also tried using type: "text", which returned:
grep: rg: unrecognized file type: text
text is not a registered ripgrep file type.
I did not run grep, rg, or the file search manually. Command Code invoked the search tool as part of handling my request.
How to reproduce
- Run Command Code
1.14.0on macOS. - Ask Command Code to search project log files for errors.
- Command Code invokes the built-in
greptool with a valid project path,glob: "**/*.log", and an error pattern. - Leave the file type empty or unset.
- Observe
rg: unrecognized file type:. - Setting the type to
textproducesrg: unrecognized file type: textinstead.
Environment
- Command Code:
1.14.0 - macOS 26.4, ARM64
- zsh (
/bin/zsh)
Workaround
Command Code worked around the problem by using its glob tool to locate log files and then opening the files individually with read_file. That worked, but it is inconvenient for large or numerous log files and does not provide the normal search/context behavior.
I was asking Command Code to investigate real application failures in the logs, including database connection errors, missing database tables, missing PHP classes, an unknown ActiveRecord property, and audit-log schema errors. I have not included any credentials or tokens that were present in those logs.
Possible fix
The type field should be optional, and an empty value should not be passed to ripgrep. The tool could also validate file types against ripgrep's registered types and return a clear validation error for unsupported values.
- Langage dominant
- Aucune donnée de langage
- Étoiles
- 4k
- Forks
- 350
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
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 CommandCodeAI/command-code
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#855 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
CommandCodeAI/command-code#841 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
CommandCodeAI/command-code#608 ·
-
Difficulté 3/5 1-2 jours Accessibilité débutants 70/100
CommandCodeAI/command-code#893 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 45/100
CommandCodeAI/command-code#892 ·
Toutes les issues de CommandCodeAI/command-code
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
hust-open-atom-club/hustmirror-cli#52 · 1 commentaire ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
qgis/QGIS-Documentation#11275 ·
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
milvus-io/birdwatcher#545 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
enhancement
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
JuliusBrussee/caveman#1102 · 1 commentaire ·