@@ -206,34 +206,49 @@ def wrapper_body(**kwargs):
206206 else :
207207 raise ValueError ("No input dataset or input messages provided" )
208208
209- input_dataset : List [EvaluationRow ] = []
210209 input_params = kwargs .get ("input_params" ) or {}
211- config = RolloutProcessorConfig (
212- model = model_name ,
213- input_params = input_params ,
214- mcp_config_path = mcp_config_path or "" ,
215- max_concurrent_rollouts = max_concurrent_rollouts ,
216- server_script_path = server_script_path ,
217- steps = steps ,
210+
211+ # Create eval metadata with test function info and current commit hash
212+ eval_metadata = EvalMetadata (
213+ name = test_func .__name__ ,
214+ description = test_func .__doc__ ,
215+ version = versioneer .get_version (),
216+ status = "running" ,
217+ num_runs = num_runs ,
218+ aggregation_method = aggregation_method ,
219+ threshold_of_success = threshold_of_success ,
220+ passed = None ,
218221 )
219- input_dataset = execute_function (rollout_processor , rows = data , config = config )
220222
221- # Populate completion_params in input_metadata for all rows
223+ # Populate completion_params in input_metadata for all rows and initialize eval_metadata BEFORE rollouts
222224 completion_params = CompletionParams (
223225 model = model_name ,
224226 temperature = input_params .get ("temperature" ),
225227 max_tokens = input_params .get ("max_tokens" ),
226228 max_tool_calls = input_params .get ("max_tool_calls" ),
227229 )
228230
229- for row in input_dataset :
231+ for row in data :
230232 if row .input_metadata is None :
231233 row .input_metadata = InputMetadata ()
232234 row .input_metadata .completion_params = completion_params
233235 # Add mode to session_data
234236 if row .input_metadata .session_data is None :
235237 row .input_metadata .session_data = {}
236238 row .input_metadata .session_data ["mode" ] = mode
239+ # Initialize eval_metadata for each row
240+ row .eval_metadata = eval_metadata
241+
242+ # Now run the rollout processor with metadata-initialized data
243+ config = RolloutProcessorConfig (
244+ model = model_name ,
245+ input_params = input_params ,
246+ mcp_config_path = mcp_config_path or "" ,
247+ max_concurrent_rollouts = max_concurrent_rollouts ,
248+ server_script_path = server_script_path ,
249+ steps = steps ,
250+ )
251+ input_dataset = execute_function (rollout_processor , rows = data , config = config )
237252
238253 all_results : List [EvaluationRow ] = []
239254 for _ in range (num_runs ):
@@ -283,21 +298,11 @@ def wrapper_body(**kwargs):
283298 if threshold_of_success is not None :
284299 passed = agg_score >= threshold_of_success
285300
286- # Create eval metadata with test function info and current commit hash
287- eval_metadata = EvalMetadata (
288- name = test_func .__name__ ,
289- description = test_func .__doc__ ,
290- version = versioneer .get_version (),
291- status = "finished" ,
292- num_runs = num_runs ,
293- aggregation_method = aggregation_method ,
294- threshold_of_success = threshold_of_success ,
295- passed = passed ,
296- )
297-
298- # Add metadata to all results before logging
301+ # Update eval metadata status and passed field for all results
299302 for r in all_results :
300- r .eval_metadata = eval_metadata
303+ if r .eval_metadata is not None :
304+ r .eval_metadata .status = "finished"
305+ r .eval_metadata .passed = passed
301306 default_logger .log (r )
302307
303308 # Check threshold after logging
0 commit comments