Skip to content

Add glob_files tool for finding files by name pattern#2342

Closed
trungutt wants to merge 4 commits intodocker:mainfrom
trungutt:add-glob-files-tool
Closed

Add glob_files tool for finding files by name pattern#2342
trungutt wants to merge 4 commits intodocker:mainfrom
trungutt:add-glob-files-tool

Conversation

@trungutt
Copy link
Copy Markdown
Contributor

@trungutt trungutt commented Apr 7, 2026

Summary

  • Adds a new built-in glob_files tool that lets the agent find files by glob pattern (e.g. **/*.go, src/**/*.ts, *.json)
  • Results are sorted by modification time (most recent first) and capped at 100 files
  • Respects VCS ignore rules (.gitignore)
  • Mirrors the Glob tool found in other coding agents (e.g. Claude Code, OpenCode)

Assisted by OpenCode

trungutt added 4 commits April 7, 2026 10:28
Adds a new built-in glob_files tool that lets the agent find files by
glob pattern (e.g. **/*.go, src/**/*.ts). Results are sorted by
modification time and capped at 100 files, matching the behavior of
similar tools in other coding agents.

Includes TUI rendering component and unit tests.
- Fix gci import ordering: separate doublestar from internal imports
- Fix perfsprint: use string concatenation instead of fmt.Sprintf
- Update all 6 e2e cassettes to include glob_files instruction text
- Add glob_files tool definition to 5 fs_tools cassettes (OpenAI,
  Anthropic, Gemini, Mistral)
- Add canonicalizeJSON to DefaultMatcher so property ordering in
  tool definitions doesn't cause mismatches between request and
  cassette bodies
- Update cassette instruction text for new glob_files tool
- Add glob_files tool definition to fs_tools cassettes
- Fix gci import ordering and perfsprint lint error
Use actual Go provider SDK serialization for tool definitions:
- OpenAI/Mistral: makeAllRequired transforms (path becomes required+nullable)
- Anthropic: raw schema preserved
- Gemini: raw schema preserved
- Revert proxy.go matcher changes (not needed with correct cassettes)
- Instruction text updated in all 6 cassettes
@trungutt trungutt requested a review from a team as a code owner April 7, 2026 11:40
@dgageot
Copy link
Copy Markdown
Member

dgageot commented Apr 7, 2026

@trungutt we used to have that but the llm would use bash instead

@trungutt
Copy link
Copy Markdown
Contributor Author

trungutt commented Apr 7, 2026

Yep, current it's not blocking, it's nice to have. Otherwise the LLM will do shell something

@derekmisler
Copy link
Copy Markdown
Contributor

/review (i'm just testing the action, @trungutt, you can ignore this comment)

@docker-agent
Copy link
Copy Markdown

docker-agent bot commented Apr 7, 2026

PR Review Failed — The review agent encountered an error and could not complete the review. View logs.

@trungutt trungutt closed this Apr 7, 2026
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