@@ -240,7 +240,7 @@ def make(
240240 return mcp_envs
241241
242242
243- def rollout (
243+ async def rollout (
244244 envs : GeneralMCPVectorEnv ,
245245 policy : Union [FireworksPolicy , LLMBasePolicy , Callable ],
246246 * ,
@@ -250,7 +250,7 @@ def rollout(
250250 steps : int = 512 ,
251251 openai_format_log_file : Optional [str ] = None ,
252252 max_concurrent_rollouts : int = 8 ,
253- ) -> List [asyncio . Task [ EvaluationRow ] ]:
253+ ) -> List [EvaluationRow ]:
254254 """
255255 Execute general rollouts using tool calling interface with automatic record/playback.
256256
@@ -282,10 +282,10 @@ def rollout(
282282
283283 Example:
284284 # Live mode
285- tasks = ep.rollout(envs, policy)
285+ results = await ep.rollout(envs, policy)
286286
287287 # Create environments automatically
288- tasks = ep.rollout(
288+ results = await ep.rollout(
289289 "http://localhost:8000/mcp/",
290290 policy,
291291 evaluation_rows=my_evaluation_rows,
@@ -294,10 +294,10 @@ def rollout(
294294
295295 # Recording mode
296296 os.environ["EP_PLAYBACK_FILE"] = "record.jsonl"
297- tasks = ep.rollout(envs, policy, openai_format_log_file="sft_data.jsonl")
297+ results = await ep.rollout(envs, policy, openai_format_log_file="sft_data.jsonl")
298298
299299 # Playback mode (after recording file exists)
300- tasks = ep.rollout(envs, policy)
300+ results = await ep.rollout(envs, policy)
301301 """
302302 # Automatically create environments if a base URL is provided
303303 if isinstance (envs , str ):
@@ -313,7 +313,10 @@ def rollout(
313313 tasks = execution_manager .execute_rollouts (
314314 envs , policy , steps , openai_format_log_file , max_concurrent_rollouts , evaluation_rows
315315 )
316- return tasks
316+
317+ # Await all tasks and return concrete EvaluationRows
318+ results : List [EvaluationRow ] = await asyncio .gather (* tasks )
319+ return results
317320
318321
319322async def test_mcp (base_url : str , seeds : List [int ]) -> Dict [str , Any ]:
0 commit comments