-
Notifications
You must be signed in to change notification settings - Fork 1.2k
🔍 Refactor and Enhance Ripgrep Tool #930
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: main
Are you sure you want to change the base?
Conversation
📋 Review SummaryThis PR refactors and enhances the ripgrep search tool with improved configuration flexibility, simplified parameters, and better resource management. The changes introduce hard limits on search results, respect for ignore files, and provide users with more control over ripgrep usage. Overall, this is a well-executed enhancement that improves the search functionality while maintaining backward compatibility where possible. 🔍 General Feedback
🎯 Specific Feedback🟡 High
🟢 Medium
🔵 Low
✅ Highlights
|
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Summary
This PR refactors the ripgrep search tool with improved configuration flexibility, simplified parameters, and better resource management. The changes introduce hard limits on search results, respect for ignore files, and provide users with more control over ripgrep usage.
🎯 Key Changes
1. Smart Output Truncation with Hard Limits
MAX_LLM_CONTENT_LENGTH = 20_000characterslimitparameter for maximum matching linesWhy this matters: Prevents overwhelming the LLM context with massive search results, improving response quality and reducing token costs.
Example output:
2. Respect for Ignore Files (.gitignore & .qwenignore)
context.fileFilteringsettings.gitignoresupport (configurable viacontext.fileFiltering.respectGitIgnore).qwenignoresupport (configurable viacontext.fileFiltering.respectQwenIgnore).qwenignorewhen presentWhy this matters:
node_modules, build artifacts, and other irrelevant files from searches3. Tool Rename for Clarity
search_file_contenttogrep_searchfor better semantic clarity4. Flexible Ripgrep Configuration
tools.useBuiltinRipgrep(default:true)true: Uses bundled ripgrep binary (cross-platform)false: Falls back to systemrgcommandtools.useRipgrepistrue🔄 Breaking Changes
search_file_contenttogrep_searchImpact:
search_file_contentshould be updated togrep_searchMigration:
If you have
tools.allowedortools.excludearrays in your settings referencing the old name, update them:📝 Documentation
docs/cli/configuration.mdwith new configuration optionsuseRipgrepanduseBuiltinRipgrepsettingsLinked issues / bugs