-
Notifications
You must be signed in to change notification settings - Fork 10.9k
feat(core): rename search_file_content tool to grep_search and add legacy alias #18003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: st/feat/tool-name-aliasing
Are you sure you want to change the base?
Conversation
|
Hi @SandyTao520, 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 @SandyTao520, 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 focuses on a significant refactoring effort to rename the 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. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
|
Build failed: Build process failed (no specific link errors found). Check logs for details. |
|
Size Change: +1.16 kB (0%) Total Size: 23.6 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request renames the search_file_content tool to grep_search and implements a backward-compatibility layer using legacy aliases, affecting documentation, policies, and tests. A critical security vulnerability has been identified where the aliasing logic in getToolAliases is incomplete, only handling unqualified tool names. This could allow policies defined with fully qualified legacy names (e.g., for MCP tools) to be bypassed when the tool is called by its new name. A recommendation has been provided to address this by making the aliasing logic aware of the server prefix in qualified names. Additionally, test quality needs improvement, specifically in tool-names.test.ts where tests validate a mock instead of the actual implementation, and in policy-engine.test.ts due to a fragile mock duplicating implementation logic.
Summary
This PR renames the
search_file_contenttool togrep_searchand introduces a legacy aliasing mechanism to ensure backward compatibility for existing security policies, skills, and user configurations.Details
search_file_contenttogrep_searchacross the codebase, including tool definitions, documentation, and policy files.search_file_contentas a legacy alias forgrep_searchintool-names.ts. This allows theToolRegistryandPolicyEngineto resolve the tool using its old name, preventing breakages in existing.tomlpolicies or custom skills.docs/tools/file-system.mdanddocs/core/subagents.mdto reflect the new naming convention.plan.toml,read-only.toml) to use the newgrep_searchname.prompts.test.tsand regenerated snapshots to verify that the system prompt correctly referencesgrep_search.Related Issues
Related to #17263
Closes #17974
How to Validate
npm test -w @google/gemini-cli-coreto ensure all core logic and aliasing tests pass.search_file_content(e.g., in a.tomlfile) and verify that it is correctly applied to thegrep_searchtool./debug prompt) to ensure it instructs the model to usegrep_search.Pre-Merge Checklist