fix(codemode): treat tools.search as the built-in search - #49249
Merged
Merged
Conversation
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.
Weaker models frequently write
tools.search({ query })instead of the baresearch({ query }), since every other codemode callable lives undertools.. Today that fails withUnknown tool 'search'. … Use search to find available tools., which from the model's point of view is what it just did, and it tends to give up on discovery and guess.This routes
tools.search(...)to the built-in search tool when no tool is registered at the rootsearchpath. A registered root-levelsearchtool still takes precedence, so nothing is reserved. The alias goes through the sameexecuteToolpath, so input validation, call accounting, and hooks are identical to the bare call.Observed while evaluating subagent model selection on
opencode/glm-5.3-flash: it wrotetools.search(...)in 5 of 10 runs that needed tool discovery, and every one of those derailed.Tests: alias returns the same result as bare
search; a registered rootsearchtool wins.