修复ChatManager类中的streams返回,避免直接返回引用以防止修改

This commit is contained in:
Windpicker-owo
2025-12-13 21:14:10 +08:00
parent f6a0fff953
commit 7211344b3c

View File

@@ -576,9 +576,8 @@ class ChatManager:
Returns:
dict[str, ChatStream]: 包含所有聊天流的字典key为stream_idvalue为ChatStream对象
注意:直接返回内部字典的引用以提高性能,调用方应避免修改
"""
return self.streams # 直接返回引用,避免复制开销
return self.streams.copy()
@staticmethod
def _build_fields_to_save(stream_data_dict: dict) -> dict: