From 12fc6f9d38e829b166f65b2091b458394044ec7b Mon Sep 17 00:00:00 2001 From: Dt8333 <25431943+Dt8333@users.noreply.github.com> Date: Sun, 12 Oct 2025 00:16:42 +0800 Subject: [PATCH] fix(LTM): fix LTM not removed when removing conversation (#3002) #2983 --- packages/astrbot/commands/conversation.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/astrbot/commands/conversation.py b/packages/astrbot/commands/conversation.py index 2f2fbc128..a29d35ea6 100644 --- a/packages/astrbot/commands/conversation.py +++ b/packages/astrbot/commands/conversation.py @@ -434,8 +434,9 @@ class ConversationCommands: await self.context.conversation_manager.delete_conversation( message.unified_msg_origin, session_curr_cid ) - message.set_result( - MessageEventResult().message( - "删除当前对话成功。不再处于对话状态,使用 /switch 序号 切换到其他对话或 /new 创建。" - ) - ) + + ret = "删除当前对话成功。不再处于对话状态,使用 /switch 序号 切换到其他对话或 /new 创建。" + if self.ltm and self.ltm_enabled(message): + cnt = await self.ltm.remove_session(event=message) + ret += f"\n聊天增强: 已清除 {cnt} 条聊天记录。" + message.set_result(MessageEventResult().message(ret))