Expand description
glob tool — find files by glob pattern (e.g. **/*.py, src/*.rs).
Why: The engineer’s tool registry historically had NO native file discovery,
so every find/ls -R went through the bash tool — the dominant agent-turn
sink on the L1 bake-off (bash was 53-71% of every turn). A structured glob
tool lets the model enumerate files in one typed call whose result the harness
can pin and reason about, instead of parsing arbitrary shell output. (#1027.)
What: GlobTool walks the working directory with a gitignore-aware walker
(ripgrep’s ignore crate — hidden files and .gitignored paths are skipped
by default) and returns every project-relative path matching the supplied
glob. An optional path scopes the walk to a subdirectory.
Test: See #[cfg(test)] below — covers a recursive match, a single-level
match, subdirectory scoping, no-match, and path traversal.
Structs§
- Glob
Tool ToolExecutorthat lists files matching a glob pattern.
Constants§
- MAX_
GLOB_ MATCHES - Maximum number of paths
GlobToolreturns in a single call.