mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-06-14 02:40:45 +08:00
fix(recall): skip pre-recall recovery on reroll reuse
This commit is contained in:
@@ -313,6 +313,7 @@ writePersistedRecallToUserMessage(rerollChat, 0, validRecord);
|
||||
|
||||
let retrieveCalled = false;
|
||||
let rerollEnsureVectorReadyCalled = false;
|
||||
let rerollRecoverHistoryCalled = false;
|
||||
const rerollStatusLabels = [];
|
||||
const rerollRuntime = {
|
||||
getIsRecalling: () => false,
|
||||
@@ -325,7 +326,10 @@ const rerollRuntime = {
|
||||
}),
|
||||
isGraphReadableForRecall: () => true,
|
||||
isGraphMetadataWriteAllowed: () => true,
|
||||
recoverHistoryIfNeeded: async () => true,
|
||||
recoverHistoryIfNeeded: async () => {
|
||||
rerollRecoverHistoryCalled = true;
|
||||
return true;
|
||||
},
|
||||
getContext: () => ({ chat: rerollChat, chatId: "chat-reroll" }),
|
||||
nextRecallRunSequence: () => 1,
|
||||
beginStageAbortController: () => ({ signal: { aborted: false } }),
|
||||
@@ -435,6 +439,11 @@ assert.equal(
|
||||
false,
|
||||
"persisted reroll reuse should not even prepare vectors before reusing the user-floor record",
|
||||
);
|
||||
assert.equal(
|
||||
rerollRecoverHistoryCalled,
|
||||
false,
|
||||
"persisted reroll reuse should not trigger pre-recall history recovery",
|
||||
);
|
||||
assert.equal(
|
||||
rerollStatusLabels.includes("召回中"),
|
||||
false,
|
||||
@@ -599,6 +608,7 @@ assert.equal(
|
||||
|
||||
console.log(" ✓ runRecallController does not reuse unbound record for active input");
|
||||
|
||||
rerollRecoverHistoryCalled = false;
|
||||
const activeInputBoundChat = [
|
||||
{ is_user: true, mes: "主动新输入绑定记录也不应复用" },
|
||||
{ is_user: false, mes: "上一条回复。", is_system: false },
|
||||
@@ -642,6 +652,11 @@ assert.equal(
|
||||
true,
|
||||
"active send-intent input should not reuse even a bound target user-floor record",
|
||||
);
|
||||
assert.equal(
|
||||
rerollRecoverHistoryCalled,
|
||||
true,
|
||||
"active send-intent input should still run normal pre-recall history recovery before fresh recall",
|
||||
);
|
||||
assert.equal(
|
||||
activeInputBoundResult.injectionText,
|
||||
"新召回:主动新输入绑定记录也不应复用",
|
||||
|
||||
Reference in New Issue
Block a user