fix(feishu): unconditionally inc streaming sequence to prevent locking; send fallback as normal msg

This commit is contained in:
jxxghp
2026-05-13 08:08:59 +08:00
parent ea8a90aa0a
commit b6062a9ce2
2 changed files with 8 additions and 4 deletions

View File

@@ -663,7 +663,7 @@ class MoviePilotAgent:
and self.should_dispatch_reply
and not self._tool_context.get("user_reply_sent")
):
await self.send_agent_message(remaining_text)
await self.send_agent_message(remaining_text, is_streaming_fallback=True)
elif (
remaining_text
and self.persist_output_message
@@ -743,17 +743,20 @@ class MoviePilotAgent:
# 确保停止流式输出
await self.stream_handler.stop_streaming()
async def send_agent_message(self, message: str, title: str = ""):
async def send_agent_message(self, message: str, title: str = "", is_streaming_fallback: bool = False):
"""
通过原渠道发送消息给用户
"""
mtype = NotificationType.System if is_streaming_fallback else NotificationType.Agent
await AgentChain().async_post_message(
Notification(
channel=self.channel,
source=self.source,
mtype=NotificationType.Agent,
mtype=mtype,
userid=self.user_id,
username=self.username,
original_message_id=self.original_message_id,
original_chat_id=self.original_chat_id,
title=title,
text=message,
)