Repository navigation
fix(codemode): Redirect every modelOnly tool from tool exposure - #3230
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
9 screenshot changes — 9 changed · 0 added · 0 removed Review screenshots in Frameshift |
thomasjiangcy
approved these changes
Nov 12, 2026
23 tasks done
This branch was successfully deployed
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.
Follow-up to #3229. That PR kept its own list of the tools to redirect (
executeTool,searchTools) incodemode/redirect.ts. Tool exposure already decides which tools a script cannot call, so the list was a second copy of that rule. It also drifts: a newmodelOnlytool would get pi's misleading hint again until someone added it by hand.Now
createPiAgentToolspasses every model tool that is not a script tool to the bridge asmodelOnlyTools. That is themodelOnlyregistry tools plussearchTools,executeTool, andcodemode. The VM declares each one, and a call to one fails with a redirect.redirect.tsowns only the text: the two specific messages forexecuteToolandsearchTools, and "X does not run in a script. Call it directly, outside the script." for the rest. SospawnAgent,handoff, and the other loop-control tools are covered too.Object.hasOwn(run.tools, name)is still the only check that lets a call run. Names that no tool has still get pi's error, labeledmissing_tool.The
codemodetool test now callstools.executeToolthrough the realcreatePiAgentToolswiring, so dropping the derived list fails a test.via @thomasjiangcy.
--
View Session [Sentry]