Repository navigation
fix(tools): treat rg as grep and scope search before pagination - #368
Merged
Merged
Conversation
Advertise only grep (OpenCode-style) but accept a tool named rg and rewrite inspection bash(rg …) — including rg | head — onto grep so search does not pay a HITL tax. Apply path and include as FFF constraints before the page limit. The previous post-filter dropped every hit when the first page lived outside the requested directory (e.g. forge under crates/).
mohitranka
added a commit
that referenced
this pull request
Aug 21, 2026
Advertise only grep (OpenCode-style) but accept a tool named rg and rewrite inspection bash(rg …) — including rg | head — onto grep so search does not pay a HITL tax. Apply path and include as FFF constraints before the page limit. The previous post-filter dropped every hit when the first page lived outside the requested directory (e.g. forge under crates/).
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Advertise only grep (OpenCode-style) but accept a tool named rg and rewrite inspection bash(rg …) — including rg | head — onto grep so search does not pay a HITL tax. Apply path and include as FFF constraints before the page limit. The previous post-filter dropped every hit when the first page lived outside the requested directory (e.g. forge under crates/).
mohitranka
added a commit
that referenced
this pull request
Sep 11, 2026
Advertise only grep (OpenCode-style) but accept a tool named rg and rewrite inspection bash(rg …) — including rg | head — onto grep so search does not pay a HITL tax. Apply path and include as FFF constraints before the page limit. The previous post-filter dropped every hit when the first page lived outside the requested directory (e.g. forge under crates/).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Models keep calling
bash(rg …)instead ofgrep, and scoped greps were returning No matches found for common terms likeforgeundercrates/.This follows OpenCode’s shape: advertise only
grep, implement ripgrep-like regex search, and acceptrgas an inbound name. Forge still rewrites inspectionbash(rg …)ontogrepso those calls do not prompt under Accept Edits.rgasgrep(not a second advertised tool)rg,/usr/bin/rg,rg -ni,--glob, andrg … | headontogreprgrewrites (-Fstays plain)pathandincludeas FFF constraints before the page limit, so a search forforgeincrates/is no longer emptied by the first 50 root/docs hitsTest plan
cargo test --package forge-search --package forge-tools --package forge-governance --package forge-core --libgrep forgewithpath=cratesafter 60 root hits still returns crate filesrgtool name andbash(rg | head)execute asgrepwithout HITL