diff --git a/index.js b/index.js index 589cd5d..44bc789 100644 --- a/index.js +++ b/index.js @@ -2848,8 +2848,9 @@ function schedulePersistedRecallMessageUiRefresh(delayMs = 0) { summary.status === "missing_message_anchor") && attemptIndex < retryDelays.length - 1; - const shouldWatchForRepaint = - summary.status === "rendered" && summary.renderedCount > 0; + // 勿在「已成功渲染」时长期挂 MutationObserver:#chat 上 class/流式更新会疯狂触发 + // runAttempt,造成满屏刷新与日志;显式事件(USER_MESSAGE_RENDERED 等)仍会 schedule 刷新。 + const shouldWatchForRepaint = false; if (!shouldRetryForPending && !shouldWatchForRepaint) { clearPersistedRecallMessageUiObserver(); diff --git a/recall-persistence.js b/recall-persistence.js index 1eaf898..b418474 100644 --- a/recall-persistence.js +++ b/recall-persistence.js @@ -134,11 +134,13 @@ export function resolveGenerationTargetUserMessageIndex( const normalizedType = String(generationType || "normal").trim() || "normal"; + // normal:取「最后一条非系统用户楼层」。若直接 return 末条非 user(常见为刚追加的助手回合), + // 会得到 null,导致持久化无法回绑到本轮 user,`hasRecordForLatest` 长期为 false。 if (normalizedType === "normal") { for (let index = chat.length - 1; index >= 0; index--) { const message = chat[index]; if (message?.is_system) continue; - return message?.is_user ? index : null; + if (message?.is_user) return index; } return null; }