refactor(planner): 将缓存消息刷新逻辑移至规划器开始时执行

This commit is contained in:
Windpicker-owo
2025-11-01 22:37:38 +08:00
parent aaf3e8f544
commit 63d5e948d2
2 changed files with 46 additions and 4 deletions

View File

@@ -330,10 +330,7 @@ class StreamLoopManager:
try:
start_time = time.time()
# 在处理开始前,先刷新缓存到未读消息
cached_messages = await self._flush_cached_messages_to_unread(stream_id)
if cached_messages:
logger.debug(f"处理开始前刷新缓存消息: stream={stream_id}, 数量={len(cached_messages)}")
# 注意缓存消息刷新已移至planner开始时执行动作修改器之后此处不再刷新
# 设置触发用户ID以实现回复保护
last_message = context.get_last_message()