From 1173adbe86caeac1cfb5811d0a5bbf5ea6b9d9d0 Mon Sep 17 00:00:00 2001 From: Dilee Date: Fri, 20 Mar 2026 11:43:39 +0300 Subject: [PATCH] fix(acp): preserve leading whitespace in streaming chunks --- agent/copilot_acp_client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/copilot_acp_client.py b/agent/copilot_acp_client.py index 7b8f45d9c..a673e059c 100644 --- a/agent/copilot_acp_client.py +++ b/agent/copilot_acp_client.py @@ -356,7 +356,7 @@ class CopilotACPClient: text_parts=text_parts, reasoning_parts=reasoning_parts, ) - return "".join(text_parts).strip(), "".join(reasoning_parts).strip() + return "".join(text_parts), "".join(reasoning_parts) finally: self.close() @@ -380,7 +380,7 @@ class CopilotACPClient: content = update.get("content") or {} chunk_text = "" if isinstance(content, dict): - chunk_text = str(content.get("text") or "").strip() + chunk_text = str(content.get("text") or "") if kind == "agent_message_chunk" and chunk_text and text_parts is not None: text_parts.append(chunk_text) elif kind == "agent_thought_chunk" and chunk_text and reasoning_parts is not None: