mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-06-14 02:40:45 +08:00
fix: restore before-combine recall interception provisional binding
This commit is contained in:
43
index.js
43
index.js
@@ -4751,6 +4751,22 @@ function freezeGenerationRecallOptionsForTransaction(
|
||||
).trim() || "normal";
|
||||
const normalizedGenerationType = optionGenerationType;
|
||||
|
||||
const overrideUserMessage = normalizeRecallInputText(
|
||||
recallOptions?.overrideUserMessage || recallOptions?.userMessage || "",
|
||||
);
|
||||
|
||||
const source =
|
||||
String(recallOptions?.overrideSource || recallOptions?.source || "").trim() ||
|
||||
(normalizeGenerationRecallTransactionType(normalizedGenerationType) === "normal"
|
||||
? "chat-tail-user"
|
||||
: "chat-last-user");
|
||||
const sourceLabel =
|
||||
String(
|
||||
recallOptions?.overrideSourceLabel ||
|
||||
recallOptions?.sourceLabel ||
|
||||
getRecallUserMessageSourceLabel(source),
|
||||
).trim() || getRecallUserMessageSourceLabel(source);
|
||||
|
||||
let targetUserMessageIndex = Number.isFinite(recallOptions?.targetUserMessageIndex)
|
||||
? Math.floor(Number(recallOptions.targetUserMessageIndex))
|
||||
: resolveGenerationTargetUserMessageIndex(chat, {
|
||||
@@ -4758,6 +4774,21 @@ function freezeGenerationRecallOptionsForTransaction(
|
||||
});
|
||||
|
||||
if (!Number.isFinite(targetUserMessageIndex)) {
|
||||
if (
|
||||
normalizeGenerationRecallTransactionType(normalizedGenerationType) === "normal" &&
|
||||
overrideUserMessage
|
||||
) {
|
||||
return {
|
||||
generationType: normalizedGenerationType,
|
||||
targetUserMessageIndex: null,
|
||||
overrideUserMessage,
|
||||
overrideSource: source,
|
||||
overrideSourceLabel: sourceLabel,
|
||||
includeSyntheticUserMessage: Boolean(
|
||||
recallOptions?.includeSyntheticUserMessage,
|
||||
),
|
||||
};
|
||||
}
|
||||
return null;
|
||||
}
|
||||
targetUserMessageIndex = Math.floor(targetUserMessageIndex);
|
||||
@@ -4777,18 +4808,6 @@ function freezeGenerationRecallOptionsForTransaction(
|
||||
return null;
|
||||
}
|
||||
|
||||
const source =
|
||||
String(recallOptions?.overrideSource || recallOptions?.source || "").trim() ||
|
||||
(normalizeGenerationRecallTransactionType(normalizedGenerationType) === "normal"
|
||||
? "chat-tail-user"
|
||||
: "chat-last-user");
|
||||
const sourceLabel =
|
||||
String(
|
||||
recallOptions?.overrideSourceLabel ||
|
||||
recallOptions?.sourceLabel ||
|
||||
getRecallUserMessageSourceLabel(source),
|
||||
).trim() || getRecallUserMessageSourceLabel(source);
|
||||
|
||||
return {
|
||||
generationType: normalizedGenerationType,
|
||||
targetUserMessageIndex,
|
||||
|
||||
Reference in New Issue
Block a user