refactor: controllerize onReroll and keep reroll harness green

This commit is contained in:
Youzini-afk
2026-03-29 17:39:41 +08:00
parent b7c986d9ea
commit 5023b75f3f
3 changed files with 196 additions and 159 deletions

View File

@@ -57,6 +57,7 @@ import {
onBeforeCombinePromptsController,
onGenerationAfterCommandsController,
} from "../event-binding.js";
import { onRerollController } from "../extraction-controller.js";
const extensionsShimSource = [
"export const extension_settings = globalThis.__p0ExtensionSettings || {};",
@@ -461,7 +462,17 @@ function createRerollHarness() {
context.onManualExtractCalls += 1;
context.lastExtractionStatus = { level: context.manualExtractLevel };
},
ensureGraphMutationReady() {
return true;
},
getGraphMutationBlockReason() {
return "graph-not-ready";
},
graphPersistenceState: {
loadState: "loaded",
},
createUiStatus,
onRerollController,
isAbortError: (e) => e?.name === "AbortError",
assertRecoveryChatStillActive() {
// no-op in test