Skip to content

feat(web): native OS notifications for agent events#19

Merged
Mokson merged 1 commit into
mainfrom
emdash/os-notifications-xco26
Jun 6, 2026
Merged

feat(web): native OS notifications for agent events#19
Mokson merged 1 commit into
mainfrom
emdash/os-notifications-xco26

Conversation

@Mokson

@Mokson Mokson commented Jun 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fires browser desktop notifications via Web Notification API when agents complete, fail, or need input while the tab is backgrounded
  • 2-second debounce collapses multiple near-simultaneous events into a single summary notification ("2 finished, 1 failed")
  • Web Audio synthesized chime plays alongside each notification (respects silent: true on the Notification itself)
  • Single "Desktop notifications" toggle in General Settings with browser permission request on enable
  • Reuses headlineForPhase and buildAgentAwarenessDeepLink from @t3tools/shared/agentAwareness

Inspired by upstream #976.

Changes

  • packages/contracts/src/settings.ts: add desktopNotificationsEnabled to ClientSettingsSchema + ClientSettingsPatch
  • packages/shared/src/agentAwareness.ts: export headlineForPhase (was private)
  • apps/web/src/notifications/osNotification.ts: pure logic (phase resolution, notification formatting, sound synthesis)
  • apps/web/src/notifications/OsNotificationCoordinator.tsx: headless coordinator (store subscription, phase diffing, debounced dispatch)
  • apps/web/src/components/settings/SettingsPanels.tsx: DesktopNotificationsSettingsRow with permission handling
  • apps/web/src/routes/__root.tsx: mount coordinator
  • apps/web/src/localApi.test.ts: add new field to test fixtures

Test plan

  • Enable "Desktop notifications" in Settings > General, verify browser permission prompt appears
  • Background the tab, trigger an agent completion, verify OS notification fires after ~2s
  • Trigger multiple agent completions in quick succession, verify they collapse into one summary
  • Click the notification, verify window focuses and navigates to the correct thread
  • Disable the toggle, verify no more notifications fire
  • Deny permission at browser level, verify toggle shows "Blocked" description and is disabled
  • Verify notification sound plays (Web Audio chime)

Fires Web Notification API alerts when agents complete, fail, or need
input while the browser tab is hidden. Notifications are debounced
(2s window) so multiple near-simultaneous completions collapse into
a single summary. Includes a Web Audio synthesized chime and a
settings toggle that requests permission on enable.
@github-actions github-actions Bot added size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Jun 6, 2026
@Mokson Mokson merged commit f0884db into main Jun 6, 2026
5 of 11 checks passed
@Mokson Mokson deleted the emdash/os-notifications-xco26 branch June 6, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant