Skip to content

Commit 93b9237

Browse files
committed
catch error
1 parent cc38838 commit 93b9237

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

eval_protocol/mcp/execution/manager.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async def _execute_with_semaphore(idx):
103103
)
104104

105105
tasks = [_execute_with_semaphore(i) for i in range(envs.n)]
106-
trajectories = await asyncio.gather(*tasks)
106+
trajectories = await asyncio.gather(*tasks, return_exceptions=True)
107107

108108
# Calculate durations
109109
total_duration = time.time() - start_time
@@ -141,6 +141,12 @@ async def _execute_with_semaphore(idx):
141141
evaluation_rows = [EvaluationRow(messages=[], input_metadata=InputMetadata()) for _ in trajectories]
142142

143143
for idx, trajectory in enumerate(trajectories):
144+
evaluation_rows[idx].input_metadata.row_id = envs.dataset_rows[idx].id
145+
evaluation_rows[idx].input_metadata.dataset_info = asdict(envs.dataset_rows[idx])
146+
if isinstance(trajectory, Exception):
147+
evaluation_rows[idx].input_metadata.session_data["error"] = True
148+
continue
149+
144150
# Handle multimodal content by extracting text from complex content structures
145151
messages = []
146152
for msg in trajectory.conversation_history:

0 commit comments

Comments
 (0)