From f8c050741cdfa2f03c55ecc3a1123c02d3051d6e Mon Sep 17 00:00:00 2001 From: "Fusion (runfusion.ai)" Date: Sat, 16 May 2026 13:10:31 -0700 Subject: [PATCH] =?UTF-8?q?feat(FN-4783):=20complete=20Step=201=20?= =?UTF-8?q?=E2=80=94=20add=20oauth=20token=20expired=20event=20types?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fusion-Task-Id: FN-4783 Fusion-Task-Lineage: 7a02897b-e303-4947-86b2-3dd7a343f653 --- packages/core/src/__tests__/notification-dispatcher.test.ts | 6 +++++- packages/core/src/types.ts | 4 +++- packages/engine/src/notifier.ts | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/core/src/__tests__/notification-dispatcher.test.ts b/packages/core/src/__tests__/notification-dispatcher.test.ts index 024dd7a48..f4463c400 100644 --- a/packages/core/src/__tests__/notification-dispatcher.test.ts +++ b/packages/core/src/__tests__/notification-dispatcher.test.ts @@ -2,7 +2,7 @@ import { describe, expect, it, vi } from "vitest"; import { NotificationDispatcher } from "../notification/dispatcher.js"; import type { NotificationProvider } from "../notification/provider.js"; import { DEFAULT_GLOBAL_SETTINGS } from "../settings-schema.js"; -import type { NtfyNotificationEvent, NotificationPayload } from "../types.js"; +import { NOTIFICATION_EVENTS, type NtfyNotificationEvent, type NotificationPayload } from "../types.js"; function createProvider(overrides: Partial = {}): NotificationProvider { const providerId = overrides.getProviderId?.() ?? "provider-default"; @@ -164,4 +164,8 @@ describe("NotificationDispatcher", () => { expect(DEFAULT_GLOBAL_SETTINGS.failureNotificationDelayMs).toBe(30000); expect(DEFAULT_GLOBAL_SETTINGS.failureNotificationMode).toBe("sticky-only"); }); + + it("includes oauth-token-expired in known notification events", () => { + expect(NOTIFICATION_EVENTS).toContain("oauth-token-expired"); + }); }); diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 9eacdac73..9368790bc 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -355,7 +355,8 @@ export type NtfyNotificationEvent = | "token-budget" | "message:agent-to-user" | "message:agent-to-agent" - | "message:room"; + | "message:room" + | "oauth-token-expired"; /** Known notification event types. Providers may support additional custom events. */ export const NOTIFICATION_EVENTS = [ @@ -372,6 +373,7 @@ export const NOTIFICATION_EVENTS = [ "message:agent-to-user", "message:agent-to-agent", "message:room", + "oauth-token-expired", ] as const; /** Notification event type. Known events plus provider-specific custom events. */ diff --git a/packages/engine/src/notifier.ts b/packages/engine/src/notifier.ts index 2e7063a5c..4d017d82b 100644 --- a/packages/engine/src/notifier.ts +++ b/packages/engine/src/notifier.ts @@ -33,6 +33,7 @@ export const DEFAULT_NTFY_EVENTS: readonly NtfyNotificationEvent[] = [ "message:agent-to-user", "message:agent-to-agent", "message:room", + "oauth-token-expired", ] as const; export interface NtfyNotificationConfigInput {