From 1125ebb390fdc2c3cf285e7a7789c67ddd30e1ea Mon Sep 17 00:00:00 2001 From: Youzini-afk <13153778771cx@gmail.com> Date: Thu, 23 Apr 2026 01:36:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8D=E6=96=B0=E6=8F=90=E5=8F=96?= =?UTF-8?q?=E5=9B=9E=E6=BB=9A=E7=82=B9=E4=B8=8D=E5=8F=AF=E7=94=A8=E6=97=B6?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E6=89=A7=E8=A1=8C=E5=8E=86=E5=8F=B2=E6=81=A2?= =?UTF-8?q?=E5=A4=8D=E5=B9=B6=E9=99=8D=E7=BA=A7=E4=B8=BA=20pending=20?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当提取/整合被中断后手动重新提取(rerun 模式)失败时,不再显示 死胡同错误,而是自动尝试历史恢复后继续提取未处理内容。 --- maintenance/extraction-controller.js | 57 +++++++++++++++++++++++++++- 1 file changed, 56 insertions(+), 1 deletion(-) diff --git a/maintenance/extraction-controller.js b/maintenance/extraction-controller.js index f9c6cdc..5a3c0da 100644 --- a/maintenance/extraction-controller.js +++ b/maintenance/extraction-controller.js @@ -1262,10 +1262,65 @@ export async function onExtractionTaskController(runtime, options = {}) { }, ); - const rollbackResult = await runtime.rollbackGraphForReroll( + let rollbackResult = await runtime.rollbackGraphForReroll( fallbackInfo.startAssistantChatIndex, context, ); + + // 回滚点不可用时,自动尝试历史恢复后降级为 pending 模式 + if ( + !rollbackResult?.success && + rollbackResult?.resultCode === "reroll.rollback.unavailable" && + typeof runtime.recoverHistoryIfNeeded === "function" + ) { + setExtractionProgressStatus( + runtime, + "重新提取准备中", + "未找到回滚点,正在自动执行历史恢复后重新提取", + "running", + { + syncRuntime: true, + toastKind: "info", + toastTitle: "ST-BME 重新提取", + }, + ); + const recovered = await runtime.recoverHistoryIfNeeded( + "rerun-rollback-unavailable", + ); + if (recovered) { + // 历史恢复成功,降级为 pending 模式继续提取 + setExtractionProgressStatus( + runtime, + "重新提取中", + "历史恢复完成,正在提取未处理内容", + "running", + { + syncRuntime: true, + toastKind: "", + toastTitle: "ST-BME 重新提取", + }, + ); + await runManualExtract({ + drainAll: true, + taskLabel: "重新提取(恢复后)", + toastTitle: "ST-BME 重新提取", + showStartToast: false, + }); + return { + success: true, + rerunPerformed: true, + recoveryFallback: true, + fallbackToLatest: true, + requestedRange: [ + rerunTask.requestedStartFloor, + rerunTask.requestedEndFloor, + ], + effectiveDialogueRange, + reason: "rollback-unavailable-recovered-pending", + }; + } + } + if (!rollbackResult?.success) { const rollbackError = String( rollbackResult?.error ||