fix: Adjust reasoning tag spacing to improve readability

This commit is contained in:
Paul Gauthier 2025-03-07 16:03:56 -08:00 committed by Paul Gauthier (aider)
parent 490c6d9a28
commit 634745c818

View file

@ -1717,10 +1717,10 @@ class Coder:
return match.group(1) return match.group(1)
# Replace opening tag with proper spacing # 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 # Replace closing tag with proper spacing
text = re.sub(f"\\s*</{tag_name}>\\s*", f"\n\n{REASONING_END}", text) text = re.sub(f"\\s*</{tag_name}>\\s*", f"\n\n{REASONING_END}\n\n", text)
# Clean up any excessive newlines (more than 2 consecutive) # Clean up any excessive newlines (more than 2 consecutive)
text = re.sub(r"\n{3,}", "\n\n", text) text = re.sub(r"\n{3,}", "\n\n", text)