From 39131d2e12bd163827d21dcd33bf3bf6ef40fcbb Mon Sep 17 00:00:00 2001 From: Yufeng He <40085740+he-yufeng@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:53:56 +0800 Subject: [PATCH] fix: Follow-up logic persists after /stop trigger (#6656) 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 6c1a4fa06..79ec16a85 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