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 {