fix: 后台模式不发送工具调用消息

This commit is contained in:
jxxghp
2026-03-31 18:25:55 +08:00
parent fc47382938
commit 84b938c0d2
+2
View File
@@ -72,6 +72,8 @@ class MoviePilotTool(BaseTool, metaclass=ABCMeta):
# 非VERBOSE,重置缓冲区从头更新,保持消息编辑能力 # 非VERBOSE,重置缓冲区从头更新,保持消息编辑能力
self._stream_handler.reset() self._stream_handler.reset()
else: else:
# 后台模式(无渠道信息)不发送工具调用消息
if self._channel:
# 非流式渠道:保持原有行为,取出 Agent 文字 + 工具消息合并独立发送 # 非流式渠道:保持原有行为,取出 Agent 文字 + 工具消息合并独立发送
agent_message = ( agent_message = (
await self._stream_handler.take() if self._stream_handler else "" await self._stream_handler.take() if self._stream_handler else ""