mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-06-13 18:31:16 +08:00
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:
@@ -577,6 +577,15 @@ export async function onGenerationAfterCommandsController(
|
||||
return;
|
||||
}
|
||||
|
||||
const generationContext = runtime.getGenerationContext?.() || null;
|
||||
const kind = generationContext?.kind || "";
|
||||
if (kind === "no-new-user") {
|
||||
return {
|
||||
skipped: true,
|
||||
reason: "no-new-user-deferred-to-before-combine",
|
||||
};
|
||||
}
|
||||
|
||||
const frozenInputSnapshot =
|
||||
generationType === "normal"
|
||||
? runtime.consumeHostGenerationInputSnapshot?.({ preserve: true }) ||
|
||||
@@ -585,7 +594,6 @@ export async function onGenerationAfterCommandsController(
|
||||
|
||||
const context = runtime.getContext();
|
||||
const chat = context?.chat;
|
||||
const generationContext = runtime.getGenerationContext?.() || null;
|
||||
|
||||
const recallOptions = runtime.buildGenerationAfterCommandsRecallInput(
|
||||
generationContext?.type || type,
|
||||
@@ -780,6 +788,16 @@ export async function onBeforeCombinePromptsController(
|
||||
}
|
||||
|
||||
if (effectiveGenerationKind === "no-new-user") {
|
||||
const reapplied = runtime.reapplyPersistedRecallBlock?.({
|
||||
generationType: effectiveGenerationType,
|
||||
generationContext,
|
||||
promptData,
|
||||
hookName: "GENERATE_BEFORE_COMBINE_PROMPTS",
|
||||
});
|
||||
if (reapplied?.applied) {
|
||||
return reapplied;
|
||||
}
|
||||
|
||||
const recallOptions =
|
||||
runtime.buildGenerationAfterCommandsRecallInput(
|
||||
effectiveGenerationType,
|
||||
|
||||
Reference in New Issue
Block a user