fix(FN-7335): keep fast completion summaries

This commit is contained in:
gsxdsm
2026-06-30 21:55:02 -07:00
parent 7d2bd9794e
commit a3ad0c8ecf
3 changed files with 31 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
---
"@runfusion/fusion": patch
---
summary: Keep workflow completion summaries running for fast-mode tasks.
category: fix
dev: Excludes completion-summary/summaryTarget task nodes from the fast-mode custom review/gate skip path.

View File

@@ -377,6 +377,24 @@ describe("fast mode workflow/runtime invariants", () => {
expect(executeScript).not.toHaveBeenCalled();
});
it.each([
["completion-summary id", { id: "completion-summary", kind: "prompt", config: { prompt: "summarize" } }],
["summaryTarget task", { id: "custom-summary", kind: "prompt", config: { prompt: "summarize", summaryTarget: "task" } }],
])("does not skip completion summary nodes in fast mode by %s", async (_label, node) => {
const { executor } = makeExecutorForTask(task({ executionMode: "fast", worktree: "/tmp/wt" }));
const executeStep = vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true, output: "Done." });
const result = await (executor as any).runGraphCustomNode(
node,
task({ executionMode: "fast" }),
{},
undefined,
);
expect(result).toMatchObject({ outcome: "success", value: "passed" });
expect(executeStep).toHaveBeenCalledTimes(1);
});
it.each(["prompt", "script", "gate"])("executes optional-group template %s nodes in fast mode", async (kind) => {
const { executor } = makeExecutorForTask(task({ executionMode: "fast", worktree: "/tmp/wt" }));
const executeStep = vi.spyOn(executor as any, "executeWorkflowStep").mockResolvedValue({ success: true });

View File

@@ -7058,7 +7058,12 @@ export class TaskExecutor {
FNXC:FastOptionalSteps 2026-06-30-09:14:
Fast skips top-level custom prompt/script/gate review bodies by default, but an enabled optional-group template is explicit operator intent. The graph marks those template nodes so Browser Verification and custom optional groups still run under fast mode.
*/
if (live.executionMode === "fast" && !optionalGroupId && !cfg.seam && (node.kind === "prompt" || node.kind === "script" || node.kind === "gate")) {
const isCompletionSummaryNode = cfg.summaryTarget === "task" || node.id === "completion-summary";
/*
FNXC:WorkflowCompletion 2026-07-01-18:42:
Fast mode skips review/validation work, not the agent-authored completion summary. FN-7335 reached review with "Fast mode — custom graph node 'completion-summary' skipped"; keep summary nodes executable so fast tasks still produce the same review/done card summary as standard tasks.
*/
if (live.executionMode === "fast" && !isCompletionSummaryNode && !optionalGroupId && !cfg.seam && (node.kind === "prompt" || node.kind === "script" || node.kind === "gate")) {
executorLog.log(`${live.id}: fast mode — skipping custom graph node '${node.id}'`);
await this.store.logEntry(
live.id,