* feat(push): filter daemon push notifications per device token preferences Persist per-token notification preferences alongside push token leases and filter agent, terminal, and plugin push deliveries per device. Agent error attention is now push-eligible and governed by per-device preferences instead of hardcoded off, while default preferences suppress finished turn pushes and keep permission, error, terminal needs-input, and plugin notifications active. * feat(app): add cross-platform notification preferences UI and client filtering Persist per-device NotificationPreferences in AppSettings, sync preferences with mobile push token registrations on capable hosts, filter desktop and web OS notifications locally (allowing error notifications by default and suppressing finished turns until enabled), and expose Settings -> Notifications across desktop, web, iOS, and Android with per-plugin mute switches covering both client and server-only plugins. * feat(plugins): add plugin notification send API and tap routing Expose server.notifications.send and client.onNotificationOpen in @getpaseo/plugin so server plugins can deliver deduplicated, rate-limited notifications through Paseo's session and Expo push pipeline while honoring per-device notification preferences and per-plugin mute switches. Tapping a plugin notification waits for the host's plugin catalog on cold launch before running client.onNotificationOpen or falling back to declarative agent, workspace, or screen open targets. * docs(plugins): add Chinese translation for notifications reference * fix(plugins): keep catalog loading before server_info and simplify push seams * fix(plugins): align notifications example Paseo requirement with current daemon version * fix: harden notification preferences compatibility and plugin notifications - Preserve legacy push filtering for mobile push tokens registered without explicit preferences so older mobile apps keep receiving agent finished pushes (tagged COMPAT(pushNotificationPreferences)) - Truncate over-limit plugin notification title (160 chars) and body (500 chars) instead of rejecting, and bound declarative open target IDs and serialized size - Skip subscribing native mobile sessions to plugin.notification so active phones do not suppress their own Expo push alerts - Restore >=0.18.0-beta.1 Paseo version requirement on plugin-examples/notifications and test against 0.18.0-beta.1 in runtime.posix.test.ts - Fall back to declarative open when every client.onNotificationOpen handler throws, keep host notification taps on router.navigate, deduplicate PluginHostNavigationActions in @getpaseo/plugin, and strengthen the muted-plugin browser E2E check * test(server): pass explicit default preferences in websocket push filter tests
4.0 KiB
Notifications
Use notification-open for OS notification taps. It owns delivery, parsing,
process-local deduplication, startup readiness, and native acknowledgement.
Keep agent and workspace navigation in their existing navigation modules.
Import the pure API from @/notification-open and the app-shell component from
@/notification-open/react; senders must not load the React routing runtime.
Agent payloads name a host and agent. Ignore their workspace hint when opening:
the agent can move after a notification is sent. Use navigateToAgent, which
uses the current store record or the agent route to resolve the workspace from
the host. Terminal payloads name their workspace and use navigateToWorkspace.
Plugin payloads carry kind: "plugin", serverId, pluginId, notificationId,
and optional open and data; openPluginNotification in
packages/app/src/plugins/notification-open.ts waits up to 8 seconds for the
target host's plugin catalog to settle on cold launch, runs registered
client.onNotificationOpen handlers with caught error isolation, and falls back
to declarative open (agent, workspace, screen) or the host root route.
See agent targets and deferred opens for route
ownership and workspace recovery. Per-device two-knob notification preferences
(@getpaseo/protocol/notification-preferences) sync with mobile push tokens via
register_push_token (gated on server_info.features.pushNotificationPreferences)
so the daemon filters Expo pushes per token, while desktop and web clients filter
in-app OS notifications locally before calling sendOsNotification. Notification
generation and presence remain daemon concerns.
Native delivery
Keep the router instance at module scope. Android's singleTask Activity can
finish on Back while its JS context remains alive. A React ref is lost when the
root remounts; process-local handled IDs must survive that remount.
Clear lastNotificationResponse after dispatch. Reading a launch response does
not acknowledge it. Without clearing it, a later Activity launch can reopen the
old agent.
With expo-notifications 57, Android also replays its pending response list to new native listeners. Clearing the last response does not drain that list. Deduplication covers listener registration within one JS context. A development JS reload creates another context and can replay a cold-launch response; do not add persisted handled IDs to compensate. Recheck this limitation when upgrading expo-notifications.
iOS drains pending responses when its delegate first handles them. Push data
read by Expo arrives under userInfo.body; simulator payloads must match:
{
"aps": { "alert": { "title": "Agent finished", "body": "Open the agent" }, "sound": "default" },
"body": {
"serverId": "host",
"workspaceId": "workspace",
"agentId": "agent",
"reason": "finished"
}
}
An Android FCM launch intent needs google.message_id and a JSON body extra.
An arbitrary Activity launch with data extras does not exercise Expo's FCM path.
Foreground pushes remain in Notification Center without a banner or sound. This preserves notifications sent with stale presence information.
Startup and verification
Wait for the root navigator, host registry, remembered selection, and startup redirects before handing off a tap. A compact agent route must demand the host's directory itself; its sidebar can be closed for the entire cold launch.
Verify warm and cold taps, stale and missing workspace hints, two distinct taps, and Android Back followed by launcher reopen or a different notification tap. Check the focused tab and every workspace's saved layout, since a foreign pinned tab survives navigation. Use the daemon's payload shape on both iOS and Android; a browser event alone does not test native replay or acknowledgement.
Existing foreign pins belong to the reconciliation fix in #6900. Desktop main-process window selection is tracked separately in #6875.