Fix extraction defer and dry-run recall guards

This commit is contained in:
Youzini-afk
2026-04-02 19:46:18 +08:00
parent 839cad7aff
commit c5edbf6046
4 changed files with 71 additions and 2 deletions

View File

@@ -211,7 +211,11 @@ export function onGenerationStartedController(
params = {},
dryRun = false,
) {
if (dryRun) return null;
if (dryRun) {
runtime.markDryRunPromptPreview?.();
return null;
}
runtime.clearDryRunPromptPreview?.();
if (params?.automatic_trigger || params?.quiet_prompt) return null;
const generationType = String(type || "normal").trim() || "normal";
@@ -382,6 +386,13 @@ export async function onBeforeCombinePromptsController(
runtime,
promptData = null,
) {
if (runtime.consumeDryRunPromptPreview?.()) {
return {
skipped: true,
reason: "dry-run-preview",
};
}
const frozenInputSnapshot =
runtime.consumeHostGenerationInputSnapshot?.() ||
runtime.getPendingHostGenerationInputSnapshot?.() ||