Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions verifiers/v1/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down