From 3c37ac21760be50a1960ee930be7018b727849c2 Mon Sep 17 00:00:00 2001 From: Yufeng He <40085740+he-yufeng@users.noreply.github.com> Date: Fri, 20 Mar 2026 10:52:00 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20/stop=20=E5=90=8E=E6=96=B0=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E4=BB=8D=E8=A2=AB=20follow-up=20=E6=8D=95=E8=8E=B7?= =?UTF-8?q?=E8=80=8C=E9=9D=9E=E4=BD=9C=E4=B8=BA=E6=96=B0=E4=BC=9A=E8=AF=9D?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /stop 设置 agent_stop_requested 标记,但 runner 直到当前工具调用 超时才从 _ACTIVE_AGENT_RUNNERS 注销。在此窗口期内,用户发的新消息 被 try_capture_follow_up() 当作 follow-up 吞掉。 在 follow-up 捕获前检查 stop 标记:一旦用户请求停止,就不再把后续 消息注入到正在终止的 agent 上下文中。 Fixes #6626 --- astrbot/core/pipeline/process_stage/follow_up.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/astrbot/core/pipeline/process_stage/follow_up.py b/astrbot/core/pipeline/process_stage/follow_up.py index 6c1a4fa06b..79ec16a85b 100644 --- a/astrbot/core/pipeline/process_stage/follow_up.py +++ b/astrbot/core/pipeline/process_stage/follow_up.py @@ -172,6 +172,9 @@ def try_capture_follow_up(event: AstrMessageEvent) -> FollowUpCapture | None: if not active_sender_id or active_sender_id != sender_id: return None + if runner_event.get_extra("agent_stop_requested"): + return None + ticket = runner.follow_up(message_text=_event_follow_up_text(event)) if not ticket: return None