fix:修复sessions会话问题

This commit is contained in:
Jerry 2025-10-21 18:29:35 +08:00
parent e8243e13c3
commit 2a901e65bf

View File

@ -194,7 +194,10 @@ async function handleMixMode(userMessage, e, aiConfig) {
} else { } else {
const matchResult = await KeywordMatcher.matchKeywords(userMessage, 'ai'); const matchResult = await KeywordMatcher.matchKeywords(userMessage, 'ai');
if (matchResult && matchResult.matched) { 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', type: 'message',
data: matchResult.text, data: matchResult.text,