From 259a744a3bf5634b1dc0ac5838a33593121a65fb Mon Sep 17 00:00:00 2001 From: Windpicker-owo <3431391539@qq.com> Date: Mon, 10 Nov 2025 13:44:52 +0800 Subject: [PATCH] =?UTF-8?q?feat(action):=20=E5=B0=86=E5=9B=9E=E5=A4=8D?= =?UTF-8?q?=E5=A4=84=E7=90=86=E9=80=BB=E8=BE=91=E5=B0=81=E8=A3=85=E4=B8=BA?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E5=87=BD=E6=95=B0=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84=E5=92=8C=E5=8F=AF=E8=AF=BB?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/planner_actions/action_manager.py | 37 ++++++++++++---------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/chat/planner_actions/action_manager.py b/src/chat/planner_actions/action_manager.py index 87aca9f88..2b2f4ed05 100644 --- a/src/chat/planner_actions/action_manager.py +++ b/src/chat/planner_actions/action_manager.py @@ -306,27 +306,30 @@ class ChatterActionManager: if action_name == "respond" and should_quote_reply is None: should_quote_reply = False - # 发送并存储回复 - loop_info, reply_text, cycle_timers_reply = await self._send_and_store_reply( - chat_stream, - response_set, - asyncio.get_event_loop().time(), - target_message, - {}, # cycle_timers - thinking_id, - [], # actions - should_quote_reply, # 传递should_quote_reply参数 - ) + async def _after_reply(): + # 发送并存储回复 + loop_info, reply_text, cycle_timers_reply = await self._send_and_store_reply( + chat_stream, + response_set, + asyncio.get_event_loop().time(), + target_message, + {}, # cycle_timers + thinking_id, + [], # actions + should_quote_reply, # 传递should_quote_reply参数 + ) - # 记录回复动作到目标消息(改为同步等待) - await self._record_action_to_message(chat_stream, action_name, target_message, action_data) + # 记录回复动作到目标消息 + await self._record_action_to_message(chat_stream, action_name, target_message, action_data) - if clear_unread_messages: - await self._clear_all_unread_messages(chat_stream.stream_id, action_name) + if clear_unread_messages: + await self._clear_all_unread_messages(chat_stream.stream_id, action_name) - # 回复成功,重置打断计数(改为同步等待) - await self._reset_interruption_count_after_action(chat_stream.stream_id) + # 回复成功,重置打断计数(改为同步等待) + await self._reset_interruption_count_after_action(chat_stream.stream_id) + return loop_info, reply_text, cycle_timers_reply + loop_info, reply_text, cycle_timers_reply = await asyncio.create_task(_after_reply()) return {"action_type": action_name, "success": True, "reply_text": reply_text, "loop_info": loop_info} except Exception as e: