fix: rename Agent.run shared_tools kwarg to tools#2093
Merged
mikasenghaas merged 1 commit intoJul 21, 2026
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 Pure mechanical rename of keyword argument from 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 routed through the internal seat plumbing, which is unchanged), so this is a rename of an undocumented kwarg.Note
Stacked on #2091 (base is
fix/agent-run-drop-on-trace); will retarget tomainonce that merges.🤖 Generated with Claude Code
Note
Low Risk
Surface-only API rename on an optional kwarg with no in-repo callers passing it; behavior and internal wiring stay the same.
Overview
Renames the public keyword on
Agent.runand_EpisodeAgent.runfromshared_toolstotools, so callers pass borrowed MCP tool servers at the run boundary without the redundant "shared" prefix.Internal rollout plumbing is unchanged:
_run_once,_rollout_params,RolloutRun,validate_pairing, and env_shared_toolsstill useshared_tools, avoiding collision withTask.tools(declared toolset classes)._EpisodeAgentstill defaults runs via_shared_forwhentoolsis omitted.Breaking:
Agent.run(..., shared_tools=...)must becomeAgent.run(..., tools=...).Reviewed by Cursor Bugbot for commit 6844eaf. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Rename
shared_toolskwarg totoolsinAgent.runand_EpisodeAgent.runRenames the
shared_toolskeyword argument totoolsin agent.py for bothAgent.runand_EpisodeAgent.run, and updates docstrings and internal call sites to match. Risk: any caller passingshared_tools=as a keyword argument will get aTypeErrorat runtime.Macroscope summarized 6844eaf.