Repository navigation
fix(codemode): suggest tools when a namespace is called - #63697
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
This works as described. I ran tools.<namespace>({}) through the Code Mode runtime on the base and with this PR, for both a flat namespace and a nested one. The base only says Tool 'X' is not callable., with no suggestions. With the PR, the error names up to three tools from the namespace and counts the rest. The search({ namespace }) command it points to does list them, nested namespaces included. bun test (1641 pass) and tsc --noEmit in packages/codemode are clean.
Public API is unchanged: this only changes the text of a Code Mode diagnostic, and the error kind is still UnknownTool.
No blocking concerns.
1 task
This was referenced Nov 13, 2026
1 task
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.
Issue for this PR
Closes #62336
Type of change
What does this PR do?
In Code Mode, calling a namespace like a tool (
tools.issues({})) only saidTool 'issues' is not callable.and the model had to guess what to call instead.Now the error names up to three real tools under that namespace and says how many more there are, same idea as the suggestions you get when reading a file that doesn't exist:
The three are picked with the existing search ranking against the namespace name, so
tools.search_skills.search_skillscomes first fortools.search_skills(...). It never lists the whole namespace. The error kind is stillUnknownTool.How did you verify your code works?
Added a test in
packages/codemode/test/tool-paths.test.tsfor a namespace with five tools, and tightened the existing single-tool one.bun test(1641 pass) andbun typecheckinpackages/codemode.Checklist