Skip to content

feat(tools): add limit and case_sensitive parameters to searchFiles - #1855

Open
liangfung wants to merge 1 commit into
mainfrom
feat/search-files-limit-and-case-sensitivity
Open

feat(tools): add limit and case_sensitive parameters to searchFiles#1855
liangfung wants to merge 1 commit into
mainfrom
feat/search-files-limit-and-case-sensitivity

Conversation

@liangfung

Copy link
Copy Markdown
Member

Summary

  • Introduces limit and case_sensitive parameters to the searchFiles tool schema.
  • Updates ripgrep search utility (searchFilesWithRipgrep) to support case-insensitive searching by default, case-sensitive on demand, and early termination at the specified limit.
  • Enhances CLI and WebUI renderers to display search limits independently from match counts.

Screenshot

image

Test plan

  • Run bun test in packages/tools to verify schema validation and JSON schema generation.
  • Run bun run test in packages/common and packages/cli to verify ripgrep behavior and renderer updates.
  • Verify through manual testing that search results are correctly limited and case-sensitivity works as expected.

🤖 Generated with Pochi | Task

Enhance the searchFiles tool by introducing `limit` and `case_sensitive` options.
By default, the ripgrep search is now case-insensitive, and stops early when a custom limit is specified.
The UI and CLI renderers have also been updated to display the custom limit independently from the match count.

🤖 Generated with [Pochi](https://getpochi.com) | [Task](https://app.getpochi.com/share/p-983b915a89a94ac6b45d35db9ed210ab)

Co-Authored-By: Pochi <noreply@getpochi.com>
@liangfung
liangfung requested a review from zhanba July 30, 2026 10:02
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.35294% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 33.47%. Comparing base (6ab281f) to head (a0edbf7).

Files with missing lines Patch % Lines
packages/cli/src/tools/search-files.ts 0.00% 6 Missing ⚠️
packages/vscode/src/tools/search-files.ts 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1855      +/-   ##
==========================================
+ Coverage   28.43%   33.47%   +5.04%     
==========================================
  Files         761      760       -1     
  Lines       78790    78811      +21     
  Branches     3684     3275     -409     
==========================================
+ Hits        22400    26385    +3985     
+ Misses      56268    52313    -3955     
+ Partials      122      113       -9     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

.describe(
"Limit output to the first N matching lines. The host already applies an internal safety limit when omitted, so only specify this when a smaller result set is necessary.",
),
case_sensitive: z

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
case_sensitive: z
caseSensitive: z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants