mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-06 07:56:52 +08:00
fix: 智能体唤醒后消息发送问题
This commit is contained in:
@@ -384,12 +384,16 @@ class MoviePilotAgent:
|
|||||||
"""
|
"""
|
||||||
通过原渠道发送消息给用户
|
通过原渠道发送消息给用户
|
||||||
"""
|
"""
|
||||||
|
user_id = self.user_id
|
||||||
|
if self.user_id == "system":
|
||||||
|
user_id = None
|
||||||
|
|
||||||
await AgentChain().async_post_message(
|
await AgentChain().async_post_message(
|
||||||
Notification(
|
Notification(
|
||||||
channel=self.channel,
|
channel=self.channel,
|
||||||
source=self.source,
|
source=self.source,
|
||||||
mtype=NotificationType.Agent,
|
mtype=NotificationType.Agent,
|
||||||
userid=self.user_id,
|
userid=user_id,
|
||||||
username=self.username,
|
username=self.username,
|
||||||
title=title,
|
title=title,
|
||||||
text=message,
|
text=message,
|
||||||
@@ -632,7 +636,7 @@ class AgentManager:
|
|||||||
try:
|
try:
|
||||||
# 每次使用唯一的 session_id,避免共享上下文
|
# 每次使用唯一的 session_id,避免共享上下文
|
||||||
session_id = f"__agent_heartbeat_{uuid.uuid4().hex[:12]}__"
|
session_id = f"__agent_heartbeat_{uuid.uuid4().hex[:12]}__"
|
||||||
user_id = settings.SUPERUSER
|
user_id = "system"
|
||||||
|
|
||||||
logger.info("智能体心跳唤醒:开始检查待处理任务...")
|
logger.info("智能体心跳唤醒:开始检查待处理任务...")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user