mirror of
https://github.com/AstrBotDevs/AstrBot.git
synced 2026-09-24 16:39:52 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user