From 74c1e7f69e4568170a4e05b8b121c5337500c2ba Mon Sep 17 00:00:00 2001 From: anka <1350989414@qq.com> Date: Wed, 23 Apr 2025 11:24:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E2=9A=92=EF=B8=8F=20=E4=BB=8D=E7=84=B6?= =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=81=8A=E5=A4=A9=E5=A2=9E=E5=BC=BA=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/astrbot/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/astrbot/main.py b/packages/astrbot/main.py index 578edb956..9dcd4a688 100644 --- a/packages/astrbot/main.py +++ b/packages/astrbot/main.py @@ -792,6 +792,13 @@ UID: {user_id} 此 ID 可用于设置管理员。 message.unified_msg_origin ) + # 长期记忆 + if self.ltm: + try: + await self.ltm.remove_session(event=message) + except Exception as e: + logger.error(f"清理聊天增强记录失败: {e}") + message.set_result( MessageEventResult().message(f"切换到新对话: 新对话({cid[:4]})。") )