From f890318ed9bc64f08e239020194b003e486a45ec Mon Sep 17 00:00:00 2001 From: zhayujie Date: Thu, 26 Mar 2026 18:13:39 +0800 Subject: [PATCH] fix: strip leading/trailing whitespace from agent response --- agent/protocol/agent_stream.py | 1 + 1 file changed, 1 insertion(+) diff --git a/agent/protocol/agent_stream.py b/agent/protocol/agent_stream.py index 1aa18b84..79dcd2ab 100644 --- a/agent/protocol/agent_stream.py +++ b/agent/protocol/agent_stream.py @@ -472,6 +472,7 @@ class AgentStreamExecutor: raise finally: + final_response = final_response.strip() if final_response else final_response logger.info(f"[Agent] 🏁 完成 ({turn}轮)") self._emit_event("agent_end", {"final_response": final_response})