Skip to content

fix(codemode): treat tools.search as the built-in search - #49249

Merged
rekram1-node merged 1 commit into
v2from
codemode-search-alias
Sep 16, 2026
Merged

rekram1-node merged 1 commit into
v2from
codemode-search-alias

Conversation

@rekram1-node

Copy link
Copy Markdown
Collaborator

Weaker models frequently write tools.search({ query }) instead of the bare search({ query }), since every other codemode callable lives under tools.. Today that fails with Unknown 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 root search path. A registered root-level search tool still takes precedence, so nothing is reserved. The alias goes through the same executeTool path, 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 wrote tools.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 root search tool wins.

@rekram1-node
rekram1-node merged commit fa3721f into v2 Sep 16, 2026
8 of 10 checks passed
@rekram1-node
rekram1-node deleted the codemode-search-alias branch September 16, 2026 00:08
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.

1 participant