fix(recall): drive reroll reuse from host generation context

This commit is contained in:
youzini
2026-05-31 20:36:14 +00:00
parent 86ecdbeeae
commit f25ad9eaa1
11 changed files with 196 additions and 150 deletions

View File

@@ -188,6 +188,12 @@ function resolveReusablePersistedRecallRecord(chat, recallInput, runtime) {
boundUserFloorText &&
currentUserFloorText === boundUserFloorText,
);
const recordRecallInputMismatch = Boolean(
recordRecallInput &&
currentUserFloorText &&
currentUserFloorText !== recordRecallInput &&
currentRecallInputText !== recordRecallInput,
);
const boundUserFloorMismatch = Boolean(
boundUserFloorText && currentUserFloorText !== boundUserFloorText,
);
@@ -199,6 +205,7 @@ function resolveReusablePersistedRecallRecord(chat, recallInput, runtime) {
const canReuseUnboundTargetRecord = Boolean(
currentUserFloorText &&
!boundUserFloorText &&
!recordRecallInput &&
!isActiveInputSource &&
String(record?.injectionText || "").trim(),
);
@@ -212,6 +219,7 @@ function resolveReusablePersistedRecallRecord(chat, recallInput, runtime) {
const canTrustUserFloorRecord = Boolean(
(!isActiveInputSource || isNoNewUserGeneration) &&
!boundUserFloorText &&
!recordRecallInputMismatch &&
(generationType !== "normal" || userFloorSources.has(recallSource)),
);