# Fix: Inconsistent Case-Sensitivity in GrepTool#26235
Conversation
This PR fixes an inconsistency in the `GrepTool` where the system grep strategy was case-sensitive, while the `git grep` and JavaScript fallback strategies were case-insensitive. ## Changes - Added the `-i` flag to the `grepArgs` array in the system grep strategy within `packages/core/src/tools/grep.ts`. - Added a unit test in `packages/core/src/tools/grep.test.ts` to verify that the `-i` flag is correctly passed to the system `grep` command. ## Impact All search strategies in `GrepTool` now behave consistently with regard to case-sensitivity (defaulting to case-insensitive). ## Verification - Ran `npm test -w @google/gemini-cli-core -- src/tools/grep.test.ts`. - Verified that the `-i` flag is correctly passed to the `grep` command.
|
Hi @gemini-cli[bot], thank you so much for your contribution to Gemini CLI! We really appreciate the time and effort you've put into this. We're making some updates to our contribution process to improve how we track and review changes. Please take a moment to review our recent discussion post: Improving Our Contribution Process & Introducing New Guidelines. Key Update: Starting January 26, 2026, the Gemini CLI project will require all pull requests to be associated with an existing issue. Any pull requests not linked to an issue by that date will be automatically closed. Thank you for your understanding and for being a part of our community! |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses an inconsistency in the GrepTool where the system grep strategy was performing case-sensitive searches while other strategies were case-insensitive. By adding the -i flag to the system grep arguments, the tool now provides uniform search behavior, improving reliability and predictability for users. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
|
Size Change: +2 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
There was a problem hiding this comment.
Code Review
This pull request adds case-insensitivity to the system grep tool by including the -i flag in the command arguments and provides a supporting unit test. A security review identified a potential argument injection vulnerability if the search pattern begins with a hyphen, suggesting the use of the -e flag to safely handle the pattern.
Co-authored-by: gemini-cli[bot] <gemini-cli[bot]@users.noreply.github.com>
Co-authored-by: gemini-cli[bot] <gemini-cli[bot]@users.noreply.github.com>
Fix: Inconsistent Case-Sensitivity in GrepTool
This PR fixes an inconsistency in the
GrepToolwhere the system grep strategy was case-sensitive, while thegit grepand JavaScript fallback strategies were case-insensitive.Changes
-iflag to thegrepArgsarray in the system grep strategy withinpackages/core/src/tools/grep.ts.packages/core/src/tools/grep.test.tsto verify that the-iflag is correctly passed to the systemgrepcommand.Impact
All search strategies in
GrepToolnow behave consistently with regard to case-sensitivity (defaulting to case-insensitive).Verification
npm test -w @google/gemini-cli-core -- src/tools/grep.test.ts.-iflag is correctly passed to thegrepcommand.