From 01454674c8f12d38bf0f632ddcd6f6e2aa3f91fb Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 7 Mar 2025 15:53:50 -0800 Subject: [PATCH] refactor: Update reasoning content formatting with improved XML-like tags --- aider/coders/base_coder.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index a02eaf2b8..7ccdfde9e 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1390,6 +1390,10 @@ class Coder: ) self.multi_response_content = "" + print() + print("="*20) + dump(self.partial_response_content) + self.io.tool_output() self.show_usage_report() @@ -1731,7 +1735,12 @@ class Coder: show_resp = self.render_incremental_response(True) if reasoning_content: - show_resp = REASONING_START + reasoning_content + REASONING_END + show_resp + show_resp = ( + f"<{REASONING_TAG}>\n\n" + + reasoning_content + + f"\n\n\n\n" + + show_resp + ) self.io.assistant_output(show_resp, pretty=self.show_pretty()) @@ -1771,7 +1780,7 @@ class Coder: reasoning_content = chunk.choices[0].delta.reasoning_content if reasoning_content: if not self.got_reasoning_content: - text += REASONING_START + text += f"<{REASONING_TAG}>\n\n" text += reasoning_content self.got_reasoning_content = True received_content = True @@ -1782,7 +1791,7 @@ class Coder: content = chunk.choices[0].delta.content if content: if self.got_reasoning_content and not self.ended_reasoning_content: - text += f"{REASONING_END}\n\n" + text += f"\n\n\n\n" self.ended_reasoning_content = True text += content