fix: improve text handling in append_text function and add test for newline preservation

This commit is contained in:
jxxghp
2026-06-16 23:28:11 +08:00
parent e78efe3e34
commit a077a08303
2 changed files with 20 additions and 1 deletions

View File

@@ -517,7 +517,7 @@ def _split_web_agent_output(text: str) -> list[dict]:
def append_text(content: str) -> None:
"""将工具汇总行从普通文本中拆出,便于前端独立展示。"""
if not content or not content.strip():
if not content:
return
lines = content.splitlines(keepends=True)
buffer = ""