grep tool passes empty file type to ripgrep
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 68/100
Direção de pesquisa
Comece pela implementação da ferramenta grep integrada e pelo ponto de entrada que constrói seus argumentos do ripgrep. Reproduza o problema com um glob e um type não definido e, em seguida, verifique que nenhum type vazio seja passado e que type não suportados recebam um erro claro. Execute os testes existentes da ferramenta grep, se houver, e adicione cobertura para ambos os casos.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Sem dados de linguagem
- Estrelas
- 4k
- Forks
- 350
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de CommandCodeAI/command-code
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CommandCodeAI/command-code#855 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
CommandCodeAI/command-code#841 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
CommandCodeAI/command-code#608 ·
-
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 70/100
CommandCodeAI/command-code#893 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
CommandCodeAI/command-code#892 ·
Todas as issues de CommandCodeAI/command-code
Issues semelhantes
-
Accept -c in more positions Abertaarea: compat bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
area: dogs bug priority: P3 silent failure test-code
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
phoenixframework/phoenix#6847 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
hust-open-atom-club/hustmirror-cli#52 · 1 comentário ·