From 6844eaf6a0e3c13997acc3b7efff182cbb607133 Mon Sep 17 00:00:00 2001 From: Mika Senghaas Date: Tue, 21 Jul 2026 14:51:01 -0700 Subject: [PATCH] fix(v1): rename Agent.run shared_tools kwarg to tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- verifiers/v1/agent.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/verifiers/v1/agent.py b/verifiers/v1/agent.py index ec4f0061af..b993469da3 100644 --- a/verifiers/v1/agent.py +++ b/verifiers/v1/agent.py @@ -221,17 +221,17 @@ async def run( task: Task, *, runtime: Runtime | None = None, - shared_tools: Mapping[str, SharedToolServer] | None = None, + tools: Mapping[str, SharedToolServer] | None = None, ) -> Trace: """Run this agent on `task` once and return the trace: `runtime` places it - into a live borrowed box instead of provisioning one; `shared_tools` are - live servers borrowed from their owner, counted in the pairing check. + into a live borrowed box instead of provisioning one; `tools` are live + servers borrowed from their owner, counted in the pairing check. Retries whole while the trace ends with a retryable error (`config.retries`) — never into a borrowed box; the final trace keeps earlier attempts' errors.""" retry = self.config.retries history: list = [] for attempt in range(retry.max_retries + 1): - trace = await self._run_once(task, runtime, shared_tools) + trace = await self._run_once(task, runtime, tools) if attempt == retry.max_retries or not trace_should_retry(trace, retry): break if runtime is not None: @@ -363,7 +363,7 @@ class _EpisodeAgent(Agent): they're created, finished ones land in `completed` (the episode's traces), each run takes the eval's gate. The taskset's shared tool servers ride only its own tasks — on an env-minted task they'd wrongly put MCP in play - (`shared_tools=` overrides).""" + (`tools=` overrides).""" def __init__( self, @@ -414,15 +414,13 @@ async def run( task: Task, *, runtime: Runtime | None = None, - shared_tools: Mapping[str, SharedToolServer] | None = None, + tools: Mapping[str, SharedToolServer] | None = None, ) -> Trace: async with self._gate or nullcontext(): trace = await super().run( task, runtime=runtime, - shared_tools=shared_tools - if shared_tools is not None - else self._shared_for(task), + tools=tools if tools is not None else self._shared_for(task), ) self._completed.append(trace) return trace