From e9642c750547d608dfa3cc9d8cdd26b8205b4c7e Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Mon, 22 May 2023 18:56:19 +0800 Subject: [PATCH] fix: #1688 wrong clear context index --- app/store/chat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/chat.ts b/app/store/chat.ts index 4abba0cf..1c82f9e0 100644 --- a/app/store/chat.ts +++ b/app/store/chat.ts @@ -345,7 +345,7 @@ export const useChatStore = create()( // wont send cleared context messages const clearedContextMessages = session.messages.slice( - (session.clearContextIndex ?? -1) + 1, + (session.clearContextIndex ?? 0), ); const messages = clearedContextMessages.filter((msg) => !msg.isError); const n = messages.length;