fix: 持久化未接受时仍在内存中推进 lastProcessedAssistantFloor

当提取核心成功但持久化未被接受时,之前不推进楼层会导致同一
会话内 pending 模式重复提取已处理的楼层。现在即使持久化未
接受也在内存中推进楼层(不追加 batchJournal,保持回滚完整性)。
重载时 floor 和图谱都会回退到最后持久化状态,保持一致。
This commit is contained in:
Youzini-afk
2026-04-23 01:52:16 +08:00
parent 9b9fd37826
commit 2bf231cfaf

View File

@@ -767,6 +767,11 @@ export async function executeExtractionBatchController(
); );
} }
} else if (!persistence.accepted) { } else if (!persistence.accepted) {
// 即使持久化未被接受,仍在内存中推进 lastProcessedAssistantFloor
// 防止同一会话内对已经抽取过的楼层重复提取。
// 此时不追加 batchJournal保持回滚完整性
// 如果用户重载floor 和图谱都会回退到最后持久化状态,保持一致。
runtime.updateProcessedHistorySnapshot(chat, endIdx);
runtime.setLastExtractionStatus( runtime.setLastExtractionStatus(
"提取待恢复", "提取待恢复",
`楼层 ${startIdx}-${endIdx} 已抽取,但持久化状态为 ${persistence.outcome || "failed"}${persistence.reason ? ` · ${persistence.reason}` : ""}`, `楼层 ${startIdx}-${endIdx} 已抽取,但持久化状态为 ${persistence.outcome || "failed"}${persistence.reason ? ` · ${persistence.reason}` : ""}`,