File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -480,21 +480,18 @@ def subagent_log_optimization_result(
480480 xml .append (" </verification>" )
481481 if diff_str :
482482 xml .append (f" <diff>{ escape (diff_str )} </diff>" )
483- for path in new_code :
484- if new_code [path ] != original_code .get (path , "" ):
485- xml .append (f' <optimized-code file="{ escape (str (path ))} ">{ escape (new_code [path ])} </optimized-code>' )
486483 xml .append (" <action>" )
487- xml .append (" 1. Review the diff and optimized code yourself. Write a brief assessment (2-3 sentences) covering:" )
484+ xml .append (" 1. Review the diff yourself. Write a brief assessment (2-3 sentences) covering:" )
488485 xml .append (" - Whether the optimization is correct and preserves behavior" )
489486 xml .append (" - What technique was used (e.g. algorithmic improvement, caching, vectorization)" )
490487 xml .append (" - Any risks or trade-offs (e.g. increased memory usage, reduced readability)" )
491488 xml .append (" 2. Present this optimization to the user using AskUserQuestion." )
492489 xml .append (" Show the function name, performance improvement, and your review as the question text." )
493- xml .append (" Provide two options: 'Apply' (write the optimized code to the file) and 'Reject' (do nothing)." )
490+ xml .append (" Provide two options: 'Apply' (apply the diff to the file) and 'Reject' (do nothing)." )
494491 xml .append (
495492 " Put the full diff in the 'Apply' option's markdown preview so the user can review the exact changes."
496493 )
497- xml .append (" 3. If the user chooses 'Apply', write the content from optimized-code to the corresponding file." )
494+ xml .append (" 3. If the user chooses 'Apply', apply the changes from the diff to the corresponding file." )
498495 xml .append (" </action>" )
499496 xml .append ("</codeflash-optimization>" )
500497
You can’t perform that action at this time.
0 commit comments