grep tool passes empty file type to ripgrep
維護者通常 1 天內回覆
@ahmadbilaldev 已經在處理了。
開始於 2026年10月22日。
評估
研究方向
從內建 grep 工具的實作以及建構其 ripgrep 引數的進入點開始。使用 glob 和未設定的 type 重現問題,然後驗證不會傳入空的 type,且不支援的 type 會收到清楚的錯誤。執行 grep 工具現有的測試(如果有),並為這兩種情況新增涵蓋測試。
由索引模型根據 Issue 內容生成。
描述
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.
- 主要語言
- 沒有語言資料
- 星號
- 4.2k
- 分支
- 377
- 平均合併
- 1 天 17 分鐘
- 30 天內合併 PR
- 7
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
CommandCodeAI/command-code 的其他 Issue
-
Provider /v1/messages rejects role:"system" inside messages[] — Claude Code ≥ 2.1.154 incompatible未關閉
難度 2/5 1-3 小時 新手友好度 75/100
CommandCodeAI/command-code#1085 ·
維護者通常 1 天內回覆
-
Feature request: auto-reconnect remote control (/rc) after restart可能已有人在做 @aliarain 於 20 天前認領。 未關閉p2
難度 2/5 1-3 小時 新手友好度 85/100
CommandCodeAI/command-code#992 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#933 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#855 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
CommandCodeAI/command-code#608 ·
維護者通常 1 天內回覆
查看 CommandCodeAI/command-code 的全部 Issue
相似的 Issue
-
nb stats: the high-error-rate anomaly and the error-causes line give different cause splits for the same errors可能已有人在做 @jeanibarz 今天認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 89/100
jeanibarz/agent-notebook#418 ·
維護者通常 1 天內回覆
-
[Bug]: graphify query loads every language extractor just for _file_stem (about 34 ms per call)可能已有人在做 @rohit-jsfreaky 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
Graphify-Labs/graphify#5160 · 1 則留言 ·
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
WenyuChiou/agent-board#1345 ·
維護者通常 1 天內回覆
-
enhancement
難度 2/5 1-3 小時 新手友好度 82/100
-
bug triage
難度 2/5 1-3 小時 新手友好度 66/100
wavetermdev/waveterm#3587 ·
維護者通常 1 天內回覆