From 45bf49998c19fbbd811ed893a49d7425c045f0be Mon Sep 17 00:00:00 2001 From: Nelson <1475262689@qq.com> Date: Sat, 11 Apr 2026 17:31:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B6=88=E6=81=AF=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wechat-bot/bot/agent_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wechat-bot/bot/agent_client.py b/wechat-bot/bot/agent_client.py index ad60ea3..4262078 100644 --- a/wechat-bot/bot/agent_client.py +++ b/wechat-bot/bot/agent_client.py @@ -120,6 +120,7 @@ async def call_agent_stream( stream_id = generate_req_id("stream") full_text = "" has_sent_final = False + has_sent_thinking = False async for line in response.aiter_lines(): if not line.startswith("data: "): @@ -148,12 +149,13 @@ async def call_agent_stream( continue full_text += text - # 实时推送"正在思考"状态 - if full_text and not has_sent_final: + # 只发送一次"正在思考"状态 + if full_text and not has_sent_thinking and not has_sent_final: try: await ws_client.reply_stream( frame, stream_id, "💭 正在思考...", False ) + has_sent_thinking = True except Exception: pass