From 83be0258a91485ea7939f75cd459284277a770ac Mon Sep 17 00:00:00 2001 From: Dustin Washington Date: Sun, 31 Aug 2025 17:27:48 -0400 Subject: [PATCH 1/2] Apply file edits irrespective of if files still need to be added to the chat, reflection should allow the model to clean up after itself --- aider/coders/base_coder.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 9a746a4f709..798198abb0f 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1728,6 +1728,15 @@ def send_message(self, inp): edited = self.apply_updates() + if edited: + self.aider_edited_files.update(edited) + saved_message = self.auto_commit(edited) + + if not saved_message and hasattr(self.gpt_prompts, "files_content_gpt_edits_no_repo"): + saved_message = self.gpt_prompts.files_content_gpt_edits_no_repo + + self.move_back_cur_messages(saved_message) + if not interrupted: add_rel_files_message = self.check_for_file_mentions(content) if add_rel_files_message: @@ -1751,15 +1760,6 @@ def send_message(self, inp): except KeyboardInterrupt: interrupted = True - if edited: - self.aider_edited_files.update(edited) - saved_message = self.auto_commit(edited) - - if not saved_message and hasattr(self.gpt_prompts, "files_content_gpt_edits_no_repo"): - saved_message = self.gpt_prompts.files_content_gpt_edits_no_repo - - self.move_back_cur_messages(saved_message) - if self.reflected_message: return From ef03b3d18e2d54ef046281ba9d8e6ebd942837c3 Mon Sep 17 00:00:00 2001 From: Dustin Washington Date: Sun, 31 Aug 2025 18:41:24 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 36a659b4bf6..d9be9c5801e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ This project aims to be compatible with upstream Aider, but with priority commit * [Manually install necessary ubuntu dependencies](https://github.com/dwash96/aider-ce/issues/14) * [.gitignore updates](https://github.com/dwash96/aider-ce/commit/7c7e803fa63d1acd860eef1423e5a03220df6017) * [Experimental Context Compaction For Longer Running Generation Tasks](https://github.com/Aider-AI/aider/issues/6) +* [Edit Before Adding Files and Reflecting](https://github.com/dwash96/aider-ce/pull/22) * [Fix Deepseek model configurations](https://github.com/Aider-AI/aider/commit/c839a6dd8964d702172cae007375e299732d3823) * [Relax Version Pinning For Easier Distribution](https://github.com/dwash96/aider-ce/issues/18)