From 7167eebe6b5a1596553b234408c9dab55637c1b6 Mon Sep 17 00:00:00 2001 From: "Fusion (runfusion.ai)" Date: Mon, 18 May 2026 07:18:10 -0700 Subject: [PATCH] =?UTF-8?q?feat(FN-5046):=20complete=20Step=202=20?= =?UTF-8?q?=E2=80=94=20add=20terminal-only=20failure=20suppression?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fusion-Task-Id: FN-5046 Fusion-Task-Lineage: 0748fd0e-70c3-44b9-a599-0df5255d4d60 --- .../engine/src/notification/notification-service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/engine/src/notification/notification-service.ts b/packages/engine/src/notification/notification-service.ts index d688d89fd..392135b03 100644 --- a/packages/engine/src/notification/notification-service.ts +++ b/packages/engine/src/notification/notification-service.ts @@ -62,7 +62,7 @@ export class NotificationService { private readonly failedNotificationGraceMs: number; private failureNotificationSuppressedCount = 0; private failureNotificationDelayMs = 60_000; - private failureNotificationMode: "sticky-only" | "all" = "sticky-only"; + private failureNotificationMode: "sticky-only" | "all" | "terminal-only" = "sticky-only"; constructor( private readonly store: NotificationServiceStore, @@ -168,7 +168,7 @@ export class NotificationService { } if (task.status === "failed") { - if (this.failureNotificationMode === "all" || this.failureNotificationDelayMs === 0) { + if (this.failureNotificationMode === "all") { this.maybeNotify(task.id, "failed", this.createTaskPayload(task, "failed")); } else { this.scheduleFailureNotification(task); @@ -564,6 +564,13 @@ export class NotificationService { return; } + const isTerminal = task.paused === true || task.column === "in-review"; + if (this.failureNotificationMode === "terminal-only" && !isTerminal) { + this.failureNotificationSuppressedCount += 1; + schedulerLog.log(`[notify] ${taskId} non-terminal failure — suppressed (mode=terminal-only)`); + return; + } + const pausedTask = task as Task & { pausedReason?: string }; let eventType: NotificationEvent = "failed"; if (