diff --git a/agent_loop.py b/agent_loop.py index 6a77a0f..c4036e8 100644 --- a/agent_loop.py +++ b/agent_loop.py @@ -110,7 +110,7 @@ def _shrink_code(m): return f'```{lang}\n{preview}\n ... ({len(body)} lines)\n```' text = re.sub(r'```[\s\S]*?```', _shrink_code, text) for p in [r'[\s\S]*?', r'[\s\S]*?', r'(\r?\n){3,}']: - text = re.sub(p, '\n\n' if '\\n' in p else '', text) + text = re.sub(p, '\n\n' if '\n' in p else '', text) return text.strip() def _compact_tool_args(name, args):