refactor(chat): 统一异步调用模式并修复循环依赖

- 将 chat_manager.get_stream() 调用改为异步
- 将 replyer_manager.get_replyer() 方法改为异步
- 在 generator_api 中使用动态导入避免循环依赖
- 在 action_manager 中添加待处理动作队列清理
- 更新所有相关调用点以支持异步模式
This commit is contained in:
Windpicker-owo
2025-10-05 18:30:16 +08:00
parent 399a7398a5
commit a513aeb68e
6 changed files with 18 additions and 14 deletions

View File

@@ -1111,7 +1111,7 @@ class MemorySystem:
from src.chat.message_receive.chat_stream import get_chat_manager
chat_manager = get_chat_manager()
chat_stream = chat_manager.get_stream(stream_id)
chat_stream = await chat_manager.get_stream(stream_id)
if chat_stream and hasattr(chat_stream, "context_manager"):
history_limit = self._determine_history_limit(context)
messages = chat_stream.context_manager.get_messages(limit=history_limit, include_unread=True)