fix: add length check before summarization in HypaV3

This commit is contained in:
Bo26fhmC5M
2025-02-07 23:31:41 +09:00
parent 6d79f45d32
commit 2fa11ebbe4

View File

@@ -442,6 +442,7 @@ export async function hypaMemoryV3(
}
// Attempt summarization
if (toSummarize.length > 0) {
const summarizeResult = await retryableSummarize(toSummarize);
if (!summarizeResult.success) {
@@ -458,6 +459,7 @@ export async function hypaMemoryV3(
chatMemos: new Set(toSummarize.map((chat) => chat.memo)),
isImportant: false,
});
}
currentTokens -= toSummarizeTokens;
startIdx = endIdx;