File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -431,14 +431,21 @@ def perform_function_optimization(
431431 server .optimizer .current_worktree , relative_file_paths , function_to_optimize_qualified_name
432432 )
433433
434+ if not patch_path :
435+ return {
436+ "functionName" : params .functionName ,
437+ "status" : "error" ,
438+ "message" : "Failed to create a patch for optimization" ,
439+ }
440+
434441 server .show_message_log (f"Optimization completed for { params .functionName } with { speedup :.2f} x speedup" , "Info" )
435442
436443 return {
437444 "functionName" : params .functionName ,
438445 "status" : "success" ,
439446 "message" : "Optimization completed successfully" ,
440447 "extra" : f"Speedup: { speedup :.2f} x faster" ,
441- "patch_file" : patch_path ,
448+ "patch_file" : str ( patch_path ) ,
442449 "task_id" : params .task_id ,
443450 "explanation" : best_optimization .explanation_v2 ,
444451 }
You can’t perform that action at this time.
0 commit comments