refactor: Add comment explaining closing tag splitting logic

This commit is contained in:
Paul Gauthier (aider) 2025-03-05 16:03:00 -08:00
parent 3d666d9929
commit 8c15802277

View file

@ -620,6 +620,7 @@ class Model(ModelSettings):
# If closing tag exists but opening tag might be missing, remove everything before closing tag
closing_tag = f"</{self.remove_reasoning}>"
if closing_tag in res:
# Split on the closing tag and keep everything after it
parts = res.split(closing_tag, 1)
res = parts[1].strip() if len(parts) > 1 else res