Skip to content

Commit 4f1f0a7

Browse files
committed
Fix MCP Rollout Processor
1 parent 56ea7ec commit 4f1f0a7

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

eval_protocol/pytest/default_mcp_gym_rollout_processor.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
from eval_protocol.models import EvaluationRow
1313
from eval_protocol.pytest.rollout_processor import RolloutProcessor
1414
from eval_protocol.pytest.types import RolloutProcessorConfig
15+
from eval_protocol.mcp.execution.manager import ExecutionManager
1516

1617

1718
class MCPServerManager:
@@ -250,22 +251,16 @@ def __call__(self, rows: List[EvaluationRow], config: RolloutProcessorConfig) ->
250251
model_id=self.policy.model_id,
251252
)
252253

253-
# Get rollout tasks from ep.rollout
254-
async def _run_rollout_and_wrap(row_index: int) -> EvaluationRow:
255-
# ep.rollout now returns concrete results
256-
assert self.policy is not None, "Policy must be initialized before rollout"
257-
results = await ep.rollout(
258-
envs,
259-
policy=self.policy,
260-
evaluation_rows=rows,
261-
steps=config.steps,
262-
max_concurrent_rollouts=config.max_concurrent_rollouts,
263-
)
264-
return results[row_index]
265-
266-
tasks: List[asyncio.Task[EvaluationRow]] = [
267-
asyncio.create_task(_run_rollout_and_wrap(i)) for i in range(len(rows))
268-
]
254+
# TODO: chat with benny/dylan about when they're back. can we just bypass ep.rollout()? i don't really see the point of it anymore. or turn it into a return list of tasks.
255+
execution_manager = ExecutionManager()
256+
tasks = execution_manager.execute_rollouts(
257+
envs,
258+
policy=self.policy,
259+
steps=config.steps,
260+
max_concurrent_rollouts=config.max_concurrent_rollouts,
261+
evaluation_rows=rows,
262+
)
263+
269264
return tasks
270265

271266
def cleanup(self) -> None:

0 commit comments

Comments
 (0)