feat(tool): add tool_search for dynamic tool discovery
Adds a new tool_search tool that allows the LLM to search for available tools by name or description using regex patterns. This is the first step toward reducing context window usage when many tools are available.
Relates to #2418
What does this PR do?
How did you verify your code works?
Thanks for your contribution!
This PR doesn't have a linked issue. All PRs must reference an existing issue.
Please:
- Open an issue describing the bug/feature (if one doesn't exist)
- Add
Fixes #<number>orCloses #<number>to this PR description
See CONTRIBUTING.md for details.
The following comment was made by an LLM, it may be inaccurate:
Based on my search results, I found one potentially related PR:
PR #7271: feat(agent): add subagents config for per-agent task tool filtering
- https://github.com/anomalyco/opencode/pull/7271
Why it might be related: This PR also addresses tool management and context optimization (filtering tools to reduce context window), though it takes a different approach through per-agent configuration rather than dynamic search. Both relate to managing tool availability and context window usage.
Otherwise, no other duplicate PRs were found for the tool_search feature itself.