From 634745c8187b9828607e254f78536d4c22fdfa36 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 7 Mar 2025 16:03:56 -0800 Subject: [PATCH] fix: Adjust reasoning tag spacing to improve readability --- aider/coders/base_coder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index bdcd061a2..7572e7cf3 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1717,10 +1717,10 @@ class Coder: return match.group(1) # Replace opening tag with proper spacing - text = re.sub(f"\\s*<{tag_name}>\\s*", f"\n\n{REASONING_START}\n", text) + text = re.sub(f"\\s*<{tag_name}>\\s*", f"\n\n{REASONING_START}\n\n", text) # Replace closing tag with proper spacing - text = re.sub(f"\\s*\\s*", f"\n\n{REASONING_END}", text) + text = re.sub(f"\\s*\\s*", f"\n\n{REASONING_END}\n\n", text) # Clean up any excessive newlines (more than 2 consecutive) text = re.sub(r"\n{3,}", "\n\n", text)