From fea4f561b4c175c6f5c1fcc842e31a475132591b Mon Sep 17 00:00:00 2001 From: Cesaryuan <35998162+cesaryuan@users.noreply.github.com> Date: Sun, 2 Apr 2023 19:43:11 +0800 Subject: [PATCH] fix: fix history message count Bug: The length of `new Array(20).slice(20 - 24) ` is 4 which should be 24. --- app/store/app.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/app.ts b/app/store/app.ts index ec0c8c50..d6fd140f 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -384,7 +384,7 @@ export const useChatStore = create()( const config = get().config; const n = session.messages.length; const recentMessages = session.messages.slice( - n - config.historyMessageCount, + - config.historyMessageCount, ); const memoryPrompt = get().getMemoryPrompt();