diff --git a/app/store/app.ts b/app/store/app.ts index da0e886f..8d875fee 100644 --- a/app/store/app.ts +++ b/app/store/app.ts @@ -478,7 +478,7 @@ export const useChatStore = create()( n - config.historyMessageCount, ); const longTermMemoryMessageIndex = session.lastSummarizeIndex; - const oldestIndex = Math.min( + const oldestIndex = Math.max( shortTermMemoryMessageIndex, longTermMemoryMessageIndex, );