Skip to content

Push notifications #16#28

Open
goncharik wants to merge 33 commits into
mainfrom
push-notifications
Open

Push notifications #16#28
goncharik wants to merge 33 commits into
mainfrom
push-notifications

Conversation

@goncharik

@goncharik goncharik commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Push Notifications

Notify the iOS app when the self-hosted agent needs the user, even while backgrounded.

Architecture (3 components, this PR is the iOS app only)

  • iOS app (this PR) — PushClient dependency client, app-delegate token/tap bridge, registration lifecycle, tap deep-link + nav-aware foreground suppression + approval badge, Settings toggle + "Send test notification", a plugin-readiness onboarding flow (below), and the push entitlement (aps-environment per-config) + remote-notification background mode.
  • Push gatewaygoncharik/hermes-mobile-push-gateway (private): stateless Cloudflare Worker holding the APNs .p8, mints the ES256 JWT, forwards to APNs.
  • hermes-push plugingoncharik/hermes-mobile-push-plugin (public): standalone pip plugin using hermes-agent's public plugin API (hermes-agent is not modified).

Privacy: only a generic title/body + session_id transit the gateway; content is fetched in-app over the private network. Plugin↔gateway HMAC is a shared secret.

Triggers (all four, via real plugin hooks — CLI + gateway)

  • approvalpre_approval_request
  • clarifypre_tool_call filtered to the clarify tool (before the user is prompted; not duration-gated; suppresses that turn's trailing complete)
  • turn-completepost_llm_call (gated to ~>10s turns via a pre_llm_call start anchor + dedup)
  • erroron_session_end (genuine failures only; not success/interrupt)

Onboarding flow

  • On the sessions list appearing, the app checks plugin readiness via GET /api/dashboard/plugins/hub (ready / not-ready / unknown).
  • Ready → request the system notification permission + register. Not ready (and not snoozed) → present a two-button info sheet. Unknown (404/error) → don't nag.
  • Info sheet: "Ask agent to install" (opens a new chat with the install prompt pre-filled, not auto-sent) + "Later" + a small GitHub link. "Later" snoozes on a Fibonacci backoff (1→2→3→5→8→13→21→34→55→60-day cap).
  • The Settings notifications toggle is gated by the same readiness check.

Tests

578 HermesKit tests + all snapshots green; app builds. (Gateway/plugin suites — 77 + 110 — live in their own repos.)

Before it works on a device (manual)

Apple: enable Push capability + create the APNs .p8. Gateway: set secrets + wrangler deploy, then point the plugin at the URL + shared HMAC secret. On-device E2E in both sandbox (Debug) and production (TestFlight).

goncharik added 26 commits June 23, 2026 15:00
@goncharik goncharik changed the title Push notifications (iOS app) Push notifications #16 Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant