fix: 当返回文本为空并且存在工具调用时错误地被终止事件,导致工具调用结果未被返回 (#2491)

fixes: #2448 #2379
This commit is contained in:
Soulter
2025-08-19 00:52:13 +08:00
committed by GitHub
parent b71000e2f3
commit 90cb5a1951
2 changed files with 4 additions and 2 deletions
@@ -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)
# 这一轮对话请求的用户输入
-2
View File
@@ -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}")