fix recall card binding lag

This commit is contained in:
Youzini-afk
2026-04-04 02:56:04 +08:00
parent 0220609018
commit 4bbbd4d09d
3 changed files with 126 additions and 4 deletions

View File

@@ -8802,6 +8802,20 @@ function onGenerationStarted(type, params = {}, dryRun = false) {
}
function onGenerationEnded(_chatLength = null) {
const recentTransaction = findRecentGenerationRecallTransactionForChat();
const recentRecallResult =
getGenerationRecallTransactionResult(recentTransaction);
ensurePersistedRecallRecordForGeneration({
generationType: recentTransaction?.generationType || "normal",
recallResult: recentRecallResult,
transaction: recentTransaction,
recallOptions: recentTransaction?.frozenRecallOptions || null,
hookName:
recentRecallResult?.hookName ||
recentTransaction?.lastRecallMeta?.hookName ||
"",
});
schedulePersistedRecallMessageUiRefresh(320);
if (typeof scheduleMessageHideApply === "function") {
scheduleMessageHideApply("generation-ended", 180);
}