From 8e2aa532522f86969f31948fec24f54b520e6805 Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Wed, 10 Sep 2025 15:17:03 +0800 Subject: [PATCH] =?UTF-8?q?fix(chat):=20=E5=B0=86=20proactive=5Freply=20?= =?UTF-8?q?=E5=8A=A8=E4=BD=9C=E6=B7=BB=E5=8A=A0=E5=88=B0=E8=B1=81=E5=85=8D?= =?UTF-8?q?=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 主动回复(proactive_reply)动作不针对特定消息,也不属于需要验证的可用工具。 此更改将其添加到 planner 的逻辑检查豁免中,以防止因缺少 `target_message_id` 或不在可用动作列表中而被错误地判定为无效。 --- src/chat/planner_actions/planner.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chat/planner_actions/planner.py b/src/chat/planner_actions/planner.py index abf543ec0..3163697d4 100644 --- a/src/chat/planner_actions/planner.py +++ b/src/chat/planner_actions/planner.py @@ -319,7 +319,7 @@ class ActionPlanner: action_data = {k: v for k, v in action_json.items() if k not in ["action", "reason"]} target_message = None - if action not in ["no_action", "no_reply", "do_nothing"]: + if action not in ["no_action", "no_reply", "do_nothing", "proactive_reply"]: if target_message_id := action_json.get("target_message_id"): target_message = self.find_message_by_id(target_message_id, message_id_list) if target_message is None: @@ -329,7 +329,7 @@ class ActionPlanner: logger.warning(f"{self.log_prefix}动作'{action}'缺少target_message_id") available_action_names = [name for name, _ in current_available_actions] - if action not in ["no_action", "no_reply", "reply", "do_nothing"] and action not in available_action_names: + if action not in ["no_action", "no_reply", "reply", "do_nothing", "proactive_reply"] and action not in available_action_names: logger.warning( f"{self.log_prefix}LLM 返回了当前不可用或无效的动作: '{action}' (可用: {available_action_names}),将强制使用 'no_action'" )