From 3dbfabad163b07259f95e3939fd80af33a15682c Mon Sep 17 00:00:00 2001 From: Youzini-afk <13153778771cx@gmail.com> Date: Thu, 26 Mar 2026 15:54:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=87=8DRoll=E7=95=99=E7=A9=BA=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E9=87=8D=E5=81=9A=E6=9C=80=E6=96=B0AI=E6=A5=BC?= =?UTF-8?q?=E8=80=8C=E9=9D=9E=E5=9B=9E=E6=BB=9A=E4=B8=8A=E4=B8=80=E6=89=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index cb6a6a4..4f4787d 100644 --- a/index.js +++ b/index.js @@ -3760,12 +3760,25 @@ async function onReroll({ fromFloor } = {}) { // 确定回滚起点 let targetFloor = Number.isFinite(fromFloor) ? fromFloor : null; if (targetFloor === null) { - // 默认:回滚到最新 AI 楼 - targetFloor = getLastProcessedAssistantFloor(); - if (targetFloor < 0) { - toastr.info("尚未有过提取记录,无需重 Roll"); + // 默认:重做最新 AI 楼 + const assistantTurns = getAssistantTurns(chat); + if (assistantTurns.length === 0) { + toastr.info("聊天中没有 AI 回复"); return; } + targetFloor = assistantTurns[assistantTurns.length - 1]; + } + + const lastProcessed = getLastProcessedAssistantFloor(); + const alreadyExtracted = targetFloor <= lastProcessed; + + if (!alreadyExtracted) { + // 目标楼层未提取过 → 直接走手动提取即可,不需要回滚 + toastr.info("该楼层尚未提取,直接执行提取…", "ST-BME 重 Roll", { + timeOut: 2000, + }); + await onManualExtract(); + return; } console.log(`[ST-BME] 重 Roll 开始,目标楼层: ${targetFloor}`);