From 2a901e65bf813e4818d8caa13c66e0e178b93980 Mon Sep 17 00:00:00 2001 From: Jerrypluay Date: Tue, 21 Oct 2025 18:29:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Dsessions=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/ai.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/ai.js b/apps/ai.js index e3e070d..4247a1e 100644 --- a/apps/ai.js +++ b/apps/ai.js @@ -194,7 +194,10 @@ async function handleMixMode(userMessage, e, aiConfig) { } else { const matchResult = await KeywordMatcher.matchKeywords(userMessage, 'ai'); if (matchResult && matchResult.matched) { - return [ + const session = SessionManager.createOrGetSession(e.group_id, e.user_id,e); + const historyLen = aiConfig.chatHistory; + const chatHistory = session.chatHistory.slice(-historyLen|-10); + const res = [ { type: 'message', data: matchResult.text,