feat(push): operational push notifications (ntfy) for agent events#119
Merged
Conversation
- src/web/push.ts: per-device push subscriptions (ntfy topic or apns token) + prefs (~/.lisa/push.json); agentPushEvents() pure trigger (done/error/permission transitions); sendNtfy() — a plain HTTP POST to a topic, so it works with zero Apple infra; PushBridge throttles + delivers on hub 'update' + Reve idle messages. APNs is a documented stub (needs an Apple push key). Payloads carry low-sensitivity metadata only.
- server: bridge wired into hub.on('update') + the idle_message broadcasts; POST /api/push/{register,unregister,prefs}, GET /api/push/list (register authed so a phone self-registers).
Fixed a latent throttle edge (first event was suppressed when now() < throttleMs).
Verified: typecheck + build clean; 753 tests pass (12 new); live-checked register/list/prefs/unregister; the ntfy send is covered by a mock-fetch unit test.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Operational push (the "agent done / errored / needs-permission" + "Reve left a note" alerts the iOS plan calls for). Opt-in, event-scoped — not proactive emotional outreach (that stays a ROADMAP non-goal); think CI notification.
Transport is pluggable, and ntfy works today with zero Apple infrastructure — delivery is a plain HTTP POST to a topic on
ntfy.sh(or your self-hosted server), so the privacy-first path the plan recommended is fully functional now.apnsis the iOS-native path and needs an Apple push key, so it's a clearly-marked stub.src/web/push.ts:~/.lisa/push.json):{ kind: "ntfy"|"apns", target, server?, prefs };prefs={done, error, permission, idle, advisor}(advisor off by default).agentPushEvents(prev, next)— pure trigger: fires on→done,→error(high), and a newly-appearingpendingPermission.sendNtfy(...)— injectable fetch;PushBridgethrottles per (session, kind) and fans out to matching subscriptions on hubupdateevents + Reveidle_message.Endpoints:
POST /api/push/register(authed — a phone self-registers),POST /api/push/unregister,GET /api/push/list,POST /api/push/prefs.Also fixed a latent throttle edge (default
lastSentof0suppressed the first event whennow()was small) →-Infinity.Verification
npm run typecheck+npm run buildclean; 753 tests / 752 pass / 1 skip / 0 fail (12 new: prefs, the pure trigger's transitions/edge-dedup, ntfy POST shape via mock fetch, bridge pref-filtering + throttle, storage).400on a missing target.🤖 Generated with Claude Code