Cesaryuan 2 лет назад
Родитель
Сommit
12f342f015
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      app/store/app.ts

+ 1 - 1
app/store/app.ts

@@ -384,7 +384,7 @@ export const useChatStore = create<ChatStore>()(
         const config = get().config;
         const n = session.messages.length;
         const recentMessages = session.messages.slice(
-          - config.historyMessageCount,
+          Math.max(0, n - config.historyMessageCount),
         );
 
         const memoryPrompt = get().getMemoryPrompt();