@@ -593,24 +593,22 @@ def determine_best_candidate(
593593 speedup_ratios [candidate .optimization_id ] = None
594594 fail_value = run_results .value
595595 if (
596- fail_value != "Test results did not match the test results of the original code."
596+ fail_value . strip () != "Test results did not match the test results of the original code."
597597 and len (future_all_refinements ) <= 3
598598 and not candidate .optimization_id .endswith ("cdrp" )
599599 ):
600600 # # queue corresponding code repair optimization for best optimization
601601 future_all_refinements .append (
602602 self .code_repair_optimizations (
603- original_source_code = candidate ,
604- modified_source_code = code_context ,
605- original_code_baseline = original_code_baseline ,
606- test_details = "test_details" ,
607- code_context = code_context ,
603+ original_source_code = code_context .read_writable_code .markdown ,
604+ modified_source_code = candidate .source_code .markdown ,
605+ test_details = fail_value ,
608606 trace_id = self .function_trace_id [:- 4 ] + exp_type
609607 if self .experiment_id
610608 else self .function_trace_id ,
611609 ai_service_client = ai_service_client ,
612610 executor = self .executor ,
613- function_references = function_references ,
611+ optimization_id = candidate . optimization_id ,
614612 )
615613 )
616614 else :
@@ -869,12 +867,13 @@ def code_repair_optimizations(
869867 modified_source_code : str ,
870868 test_details : str ,
871869 trace_id : str ,
870+ optimization_id : str ,
872871 ai_service_client : AiServiceClient ,
873872 executor : concurrent .futures .ThreadPoolExecutor ,
874873 ) -> concurrent .futures .Future :
875874 request = [
876875 AIServiceCodeRepairRequest (
877- optimization_id = "" ,
876+ optimization_id = optimization_id ,
878877 original_source_code = original_source_code ,
879878 modified_source_code = modified_source_code ,
880879 test_details = test_details ,
0 commit comments