From 90cb5a19510a101598d23a82d682e18d078db531 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Tue, 19 Aug 2025 00:52:13 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BD=93=E8=BF=94=E5=9B=9E=E6=96=87?= =?UTF-8?q?=E6=9C=AC=E4=B8=BA=E7=A9=BA=E5=B9=B6=E4=B8=94=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=E8=B0=83=E7=94=A8=E6=97=B6=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E5=9C=B0=E8=A2=AB=E7=BB=88=E6=AD=A2=E4=BA=8B=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E5=B7=A5=E5=85=B7=E8=B0=83=E7=94=A8=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=9C=AA=E8=A2=AB=E8=BF=94=E5=9B=9E=20(#2491)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes: #2448 #2379 --- astrbot/core/pipeline/process_stage/method/llm_request.py | 4 ++++ astrbot/core/pipeline/respond/stage.py | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/astrbot/core/pipeline/process_stage/method/llm_request.py b/astrbot/core/pipeline/process_stage/method/llm_request.py index 6820da33e..c81a5df51 100644 --- a/astrbot/core/pipeline/process_stage/method/llm_request.py +++ b/astrbot/core/pipeline/process_stage/method/llm_request.py @@ -335,6 +335,10 @@ class LLMRequestSubStage(Stage): ): return + if not llm_response.completion_text and not req.tool_calls_result: + logger.debug("LLM 响应为空,不保存记录。") + return + # 历史上下文 messages = copy.deepcopy(req.contexts) # 这一轮对话请求的用户输入 diff --git a/astrbot/core/pipeline/respond/stage.py b/astrbot/core/pipeline/respond/stage.py index 54ad1e63b..77e62ec7c 100644 --- a/astrbot/core/pipeline/respond/stage.py +++ b/astrbot/core/pipeline/respond/stage.py @@ -144,8 +144,6 @@ class RespondStage(Stage): try: if await self._is_empty_message_chain(result.chain): logger.info("消息为空,跳过发送阶段") - event.clear_result() - event.stop_event() return except Exception as e: logger.warning(f"空内容检查异常: {e}")