fix: rename Agent.run shared_tools kwarg to tools#2094
Merged
Conversation
At the run boundary "shared" is implied — the caller just passes the tool servers this run may use. Rename the public kwarg on Agent.run and _EpisodeAgent.run to `tools`. The internal "shared tool servers" infra keeps its name (Env.shared_tools(), RolloutRun, validate_pairing, mcp/launch): those servers are genuinely shared/borrowed across an eval, and `tools` there would collide with Task.tools (declared toolset classes). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
ApprovabilityVerdict: Approved Mechanical rename of You can customize Macroscope's approvability policy. Learn more. |
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.
Summary
Agent.run/_EpisodeAgent.runfromshared_toolstotools. At the run boundary "shared" is implied — the caller just hands over the tool servers this run may use.Env.shared_tools(),RolloutRun,validate_pairing,mcp/launch): those servers are genuinely shared/borrowed across a whole eval, and calling themtoolsthere would collide withTask.tools(the declared toolset classes). So the rename is scoped to the.runsurface, with the seam kept atRolloutRun.Breaking
Agent.run(..., shared_tools=...)→Agent.run(..., tools=...). No in-repo callers passed it (the only consumer routes through internal seat plumbing, which is unchanged), so this is a rename of an undocumented kwarg.Note
This re-targets the change from #2093 (which merged into a stacked branch, not
main) directly atmain.🤖 Generated with Claude Code
Note
Low Risk
Keyword-only API rename with no in-repo callers; behavior and internal
shared_toolsplumbing are unchanged.Overview
Renames the public
toolskeyword onAgent.runand_EpisodeAgent.run(formerlyshared_tools), so callers pass borrowed MCP tool servers at the run boundary without the redundant “shared” prefix._EpisodeAgentstill defaults from env-ownedshared_toolswhentoolsis omitted; internal rollout plumbing (_run_once,RolloutRun,validate_pairing,Env.shared_tools()) keeps theshared_toolsname to avoid clashing withTask.tools.Reviewed by Cursor Bugbot for commit b0fbf04. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Rename
shared_toolsparameter totoolsinAgent.runand_EpisodeAgent.runRenames the
shared_toolskeyword argument totoolsin agent.py for bothAgent.runand_EpisodeAgent.run. Risk: callers passingshared_tools=as a keyword argument will receive aTypeError.Macroscope summarized b0fbf04.