From ebd73c11930f7b1cc701ceea08afdbf245ba0dc7 Mon Sep 17 00:00:00 2001 From: shijianhuai Date: Thu, 19 Mar 2026 14:38:53 +0800 Subject: [PATCH 1/2] fix: prevent empty fallback replies from clearing wecom ai bot output --- astrbot/core/pipeline/scheduler.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/astrbot/core/pipeline/scheduler.py b/astrbot/core/pipeline/scheduler.py index ffb9c5c99c..5391e41cc6 100644 --- a/astrbot/core/pipeline/scheduler.py +++ b/astrbot/core/pipeline/scheduler.py @@ -87,7 +87,10 @@ async def execute(self, event: AstrMessageEvent) -> None: await self._process_stages(event) # 如果没有发送操作, 则发送一个空消息, 以便于后续的处理 - if isinstance(event, WebChatMessageEvent | WecomAIBotMessageEvent): + if ( + isinstance(event, WebChatMessageEvent | WecomAIBotMessageEvent) + and not event._has_send_oper + ): await event.send(None) logger.debug("pipeline 执行完毕。") From 73febdca609d4f47b34f58b28284157dd09e308e Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Thu, 19 Mar 2026 16:53:30 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E5=8F=91=E9=80=81=E9=80=BB=E8=BE=91=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E5=8F=91=E9=80=81=E7=A9=BA=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/core/pipeline/scheduler.py | 3 +-- astrbot/core/platform/sources/wecom_ai_bot/wecomai_event.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/astrbot/core/pipeline/scheduler.py b/astrbot/core/pipeline/scheduler.py index 5391e41cc6..4af41eef2b 100644 --- a/astrbot/core/pipeline/scheduler.py +++ b/astrbot/core/pipeline/scheduler.py @@ -86,10 +86,9 @@ async def execute(self, event: AstrMessageEvent) -> None: try: await self._process_stages(event) - # 如果没有发送操作, 则发送一个空消息, 以便于后续的处理 + # 发送一个空消息, 以便于后续的处理 if ( isinstance(event, WebChatMessageEvent | WecomAIBotMessageEvent) - and not event._has_send_oper ): await event.send(None) diff --git a/astrbot/core/platform/sources/wecom_ai_bot/wecomai_event.py b/astrbot/core/platform/sources/wecom_ai_bot/wecomai_event.py index b7cf189e1d..9f0c569d1b 100644 --- a/astrbot/core/platform/sources/wecom_ai_bot/wecomai_event.py +++ b/astrbot/core/platform/sources/wecom_ai_bot/wecomai_event.py @@ -135,6 +135,8 @@ def _extract_plain_text_from_chain(message_chain: MessageChain | None) -> str: async def send(self, message: MessageChain | None) -> None: """发送消息""" + if message is None: + return raw = self.message_obj.raw_message assert isinstance(raw, dict), ( "wecom_ai_bot platform event raw_message should be a dict"