fix(recall): deterministic persisted reapply on reroll (Phase 1 inject-decoupling)

Reroll (swipe/regenerate/continue = no-new-user) now deterministically
reapplies the parent user floor's stored bme_recall block in
GENERATE_BEFORE_COMBINE_PROMPTS, bypassing the transaction gate and
runRecall entirely. AFTER_COMMANDS defers no-new-user work to
before-combine. Staleness guard recomputes when the user edited the
floor; settings gate honors plugin/recall disable. Fresh normal sends
are unaffected. Compute machinery retained as fallback.
This commit is contained in:
youzini
2026-06-01 05:52:45 +00:00
parent f1764669d9
commit f986bcc293
6 changed files with 348 additions and 1 deletions

View File

@@ -555,6 +555,7 @@ export async function createGenerationRecallHarness(options = {}) {
resolveFinalRecallInjectionSource,
resolveGenerationRecallDeliveryMode: (...args) =>
generationRecallTransactionRuntime.resolveGenerationRecallDeliveryMode(...args),
resolveGenerationTargetUserMessageIndex,
resolveRecallPersistenceTargetUserMessageIndex,
schedulePersistedRecallMessageUiRefresh,
setLastInjectionContent: (value = "") => {
@@ -659,6 +660,8 @@ export async function createGenerationRecallHarness(options = {}) {
markGenerationRecallTransactionHookState: (...args) =>
generationRecallTransactionRuntime.markGenerationRecallTransactionHookState(...args),
normalizeRecallInputText,
reapplyPersistedRecallBlock: (...args) =>
finalRecallInjectionRuntime.reapplyPersistedRecallBlock(...args),
refreshPersistedRecallMessageUi: schedulePersistedRecallMessageUiRefresh,
resolveGenerationRecallDeliveryMode: (...args) =>
generationRecallTransactionRuntime.resolveGenerationRecallDeliveryMode(...args),
@@ -820,6 +823,8 @@ export async function createGenerationRecallHarness(options = {}) {
finalRecallInjectionRuntime.persistRecallInjectionRecord(...args),
ensurePersistedRecallRecordForGeneration: (...args) =>
finalRecallInjectionRuntime.ensurePersistedRecallRecordForGeneration(...args),
reapplyPersistedRecallBlock: (...args) =>
finalRecallInjectionRuntime.reapplyPersistedRecallBlock(...args),
findRecentGenerationRecallTransactionForChat: (...args) =>
generationRecallTransactionRuntime.findRecentGenerationRecallTransactionForChat(...args),
getGenerationRecallTransactionResult: (...args) =>