Browse Source

Merge pull request #1689 from Yidadaa/Yidadaa-patch-1

fix: #1688 wrong clear context index
Yifei Zhang 1 year ago
parent
commit
bb0c3835f4
1 changed files with 1 additions and 1 deletions
  1. 1 1
      app/store/chat.ts

+ 1 - 1
app/store/chat.ts

@@ -345,7 +345,7 @@ export const useChatStore = create<ChatStore>()(
 
         // 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;