Skip to content

refactor: remove optimized-code tag from subagent XML output#1842

Merged
misrasaurabh1 merged 2 commits intomainfrom
remove-optimizer-tag-subagent
Mar 16, 2026
Merged

refactor: remove optimized-code tag from subagent XML output#1842
misrasaurabh1 merged 2 commits intomainfrom
remove-optimizer-tag-subagent

Conversation

@aseembits93
Copy link
Copy Markdown
Contributor

Summary

  • Removes the <optimized-code> tag from the subagent XML output in subagent_log_optimization_result, which was embedding full file contents redundantly
  • Updates action instructions to direct the subagent to apply changes from the diff instead

Test plan

  • Verify subagent mode optimization flow still works correctly using only the diff for applying changes

🤖 Generated with Claude Code

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented Mar 16, 2026

Claude finished @aseembits93's task in 15s —— View job


PR Review Summary

Prek Checks

All checks passed — ruff format and ruff lint both clean on changed files.

Code Review

The change is clean and focused. Removing <optimized-code> tags makes sense since the diff is already included in the XML and the subagent can apply changes from it directly. Full file content was redundant.

One minor point worth noting (pre-existing, not introduced by this PR):

Edge case: files added by optimization — The diff is built by iterating over original_code keys (for path in original_code: at console.py:432), which means if an optimization ever added a new file (present in new_code but absent in original_code), it wouldn't appear in the diff. The old <optimized-code> loop iterated over new_code keys so it would have captured such files. In practice, CodeFlash optimizations don't add new files, so this is a theoretical concern only.

No functional bugs in the changes themselves.

Duplicate Detection

No duplicates detected.

Test Coverage

codeflash/cli_cmds/console.py has 19% coverage (pre-existing). No unit tests exist for subagent_log_optimization_result. Test suite has 8 pre-existing failures in test_tracer.py unrelated to this PR (3549 passed).


Last updated: 2026-03-16

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@aseembits93 aseembits93 force-pushed the remove-optimizer-tag-subagent branch from cddee55 to c544ce6 Compare March 16, 2026 22:58
@aseembits93 aseembits93 requested a review from KRRT7 March 16, 2026 22:58
misrasaurabh1
misrasaurabh1 previously approved these changes Mar 16, 2026
@aseembits93 aseembits93 enabled auto-merge March 16, 2026 23:01
@misrasaurabh1 misrasaurabh1 disabled auto-merge March 16, 2026 23:02
@misrasaurabh1 misrasaurabh1 merged commit 4e55159 into main Mar 16, 2026
26 of 27 checks passed
@misrasaurabh1 misrasaurabh1 deleted the remove-optimizer-tag-subagent branch March 16, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants