This commit is contained in:
tt-P607
2025-10-31 20:52:54 +08:00
46 changed files with 1250 additions and 7586 deletions

View File

@@ -410,11 +410,9 @@ class ChatterPlanExecutor:
)
# 添加到chat_stream的已读消息中
if hasattr(chat_stream, "stream_context") and chat_stream.stream_context:
chat_stream.stream_context.history_messages.append(bot_message)
logger.debug(f"机器人回复已添加到已读消息: {reply_content[:50]}...")
else:
logger.warning("chat_stream没有stream_context无法添加已读消息")
chat_stream.context_manager.context.history_messages.append(bot_message)
logger.debug(f"机器人回复已添加到已读消息: {reply_content[:50]}...")
except Exception as e:
logger.error(f"添加机器人回复到已读消息时出错: {e}")

View File

@@ -96,7 +96,7 @@ class ProactiveThinkingMessageHandler(BaseEventHandler):
"""处理消息事件
Args:
kwargs: 事件参数,格式为 {"message": MessageRecv}
kwargs: 事件参数,格式为 {"message": DatabaseMessages}
Returns:
HandlerResult: 处理结果
@@ -104,7 +104,7 @@ class ProactiveThinkingMessageHandler(BaseEventHandler):
if not kwargs:
return HandlerResult(success=True, continue_process=True, message=None)
# 从 kwargs 中获取 MessageRecv 对象
# 从 kwargs 中获取 DatabaseMessages 对象
message = kwargs.get("message")
if not message or not hasattr(message, "chat_stream"):
return HandlerResult(success=True, continue_process=True, message=None)