Skip to content

feat(mobile): make agent notifications feel like an inbox - #16

Draft
wSedlacek wants to merge 15 commits into
mainfrom
t3/server-mobile-notifications
Draft

wSedlacek wants to merge 15 commits into
mainfrom
t3/server-mobile-notifications

Conversation

@wSedlacek

Copy link
Copy Markdown

Reopened from closed upstream PR pingdotgg#32592 as a draft for t3.1code.
Idea rank: 15 of 108. Branch is as it was upstream; it likely needs a rebase (modernize) before review.

Summary

Mobile agent notifications were laggy, chatty mid-run, and easy to miss when a completion was held for five seconds waiting to see if more work would start. This reframes them as an inbox, not a live tool transcript.

Mental model

Think email, not a streaming console:

Surface Always updates? Buzzes / banners?
Live Activity / ongoing card Yes — Working / Done / Needs reply No (content only), unless an alert is attached
Banner / companion push Only on Done or Needs reply Yes — unless you are actively on web/desktop

Copy stays short and status-shaped: Working, Ready to review, Needs your reply, All caught up. Mid-run tool chatter no longer drives banners.

How delivery works (host → relay → phone)

  1. Host (AgentAwarenessRelay) projects each listed thread into awareness state (phase + status). Subagent/side-chat approvals roll up onto the parent. Completions and failures publish immediately (the old ~5s completion hold dropped most banners when a follow-up queued inside the window). Tombstones still wait ~1.5s so a clear cannot race a live update.
  2. Presence (BackgroundPolicy.shouldSuppressMobileNotificationAlerts): if a web or desktop client is visible + focused + recently interacted, and the host is not idle / locked / suspended, the publish sets suppressAlerts: true. Live Activity content still refreshes; audible banners and companion pushes do not.
  3. Relay keeps LA updates snappy (~3s floor, aligned with host coalescing), prefers a real push token companion for Done/Needs-reply (LA alert payloads alone stay silent when the activity token is stale or the card was dismissed), and sets APNs interruption-level: active so Focus / notification summary still apply without treating these as time-sensitive.
  4. Mobile settings stay Off / Banners / Live Activity; the widget header reads like an inbox summary.

Deploy note

Device feel needs both a host with this build and a relay deploy. Host-only or relay-only will leave half the path on the old behavior.

Test plan

  • Focused suites: BackgroundPolicy, AgentAwarenessRelay, ApnsClient, ApnsDeliveries, relay Api publish path
  • Active on web/desktop → Live Activity updates, no banner on completion
  • Walk away / lock / idle (or stop interacting ~45s) → completion / needs-reply does banner
  • Mid-run tool status changes refresh the Live Activity without ringing
  • Needs-reply (approval / user input, including rolled-up subagent approval) banners
  • Immediate completion after a short run (no multi-second hold before the banner)
  • Android FCM path still respects suppressAlerts

Created with Composer in Cursor.

🤖 Generated with Claude Code

wSedlacek and others added 15 commits November 9, 2026 09:12
Treat Live Activity as always-updating status and reserve banners for done/needs-reply, quieting them while you are actively on web/desktop.
Restore post-send Live Activity arming, clear rolled-up parent attention on side-chat delete, retry banner registration, keep content-only APNs at priority 5, and only companion-push on real alert transitions.
Keep main widget publishing and Android permission gating, drop the overlapping subagent-approval rollup Julius flagged, and leave side-chat rollup plus inbox notification behavior on top.
Seed childParentByThreadRef from thread.deleted payloads so catch-up or reset gaps still clear rolled-up Needs your reply state.
The shell helper is not an AppThread payload; cast the test event so server typecheck passes.
Avoid family-wide projection scans for side-chat rollups, suppress
mobile banners only for the linked CloudLink user, and advance parent
alert timestamps from child side-chat waits so Android does not drop
repeats.

Co-authored-by: Cursor <cursoragent@cursor.com>
…fications

Co-authored-by: Cursor <cursoragent@cursor.com>
…ledger

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 14, 2026
@github-actions

Copy link
Copy Markdown

This PR changes the test suite by +21 test cases (browser 0, unit +13, server +8).

Keep tests that would fail for a real reason, and test logic below the UI where it can be. See Testing.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants