From ff5e8b63a2068a92a162897afba169da69174cf8 Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Sat, 23 Aug 2025 01:02:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(chat):=20=E5=9C=A8PROACTIVE=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E5=85=81=E8=AE=B8do=5Fnothing=E5=8A=A8?= =?UTF-8?q?=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在PROACTIVE模式下,`do_nothing` 是一个有效的规划动作,表示主动聊天轮次中不需要执行额外操作。此更改将其添加到有效动作的判断逻辑中,以避免被错误地记录为无效动作。 --- src/chat/planner_actions/planner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/chat/planner_actions/planner.py b/src/chat/planner_actions/planner.py index ba0db820f..f6c55308a 100644 --- a/src/chat/planner_actions/planner.py +++ b/src/chat/planner_actions/planner.py @@ -330,7 +330,11 @@ class ActionPlanner: - if action != "no_reply" and action != "reply" and action not in current_available_actions: + if action == "no_action": + reasoning = "normal决定不使用额外动作" + elif mode == ChatMode.PROACTIVE and action == "do_nothing": + pass # 在PROACTIVE模式下,do_nothing是有效动作 + elif action != "no_reply" and action != "reply" and action not in current_available_actions: logger.warning( f"{self.log_prefix}LLM 返回了当前不可用或无效的动作: '{action}' (可用: {list(current_available_actions.keys())}),将强制使用 'no_reply'" )