fix: Follow-up logic persists after /stop trigger (#6656)

/stop 设置 agent_stop_requested 标记,但 runner 直到当前工具调用
超时才从 _ACTIVE_AGENT_RUNNERS 注销。在此窗口期内,用户发的新消息
被 try_capture_follow_up() 当作 follow-up 吞掉。

在 follow-up 捕获前检查 stop 标记:一旦用户请求停止,就不再把后续
消息注入到正在终止的 agent 上下文中。

Fixes #6626
This commit is contained in:
Yufeng He
2026-03-20 13:53:56 +08:00
committed by GitHub
parent 735bd43648
commit 39131d2e12
@@ -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