Skip to content

Commit 4e55159

Browse files
Merge pull request #1842 from codeflash-ai/remove-optimizer-tag-subagent
refactor: remove optimized-code tag from subagent XML output
2 parents 89dc5fe + 56e19a3 commit 4e55159

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

codeflash/cli_cmds/console.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)