Open-source Grok Bot alternative with a virtual machine that bots can use
Phone push: alerts when the phone app is closed
Today the MausBot phone app only gets a notification while it is connected to its
computer or Cloud. The app builds every notification itself from the live event
stream (notify frames). So an alert arrives while the app is open, for about
25 seconds after it goes to the background on iPhone, or all the time on Android
with Always-on turned on. When the phone is locked for longer, or the app was
swiped away, nothing arrives.
This document describes real push: Apple's push service (APNs) on iPhone and Firebase Cloud Messaging (FCM) on Android wake the phone even when the app is closed. It is on by default for anyone who pairs a phone: there is no setting to find (see "Who gets it"). The keys are in place on iPhone; Android does not have push yet (see "Switching it on").
Who gets it
Phone push is on by default on every desktop, every Cloud home (My Cloud and
Team Cloud) and every openmausbot serve server. It does anything only for a
phone that is paired and registers: a computer with no paired phone keeps no
registration, makes no call to the control plane or the Admin, sets no timer and
holds no connection for it, at start or later.
What a paired phone gets, by how it was paired. "Anywhere" is Settings → Devices → How your phone reaches this computer → Anywhere, through MausBot, which signs the computer in with an emailed code and stores its installation credential.
| Paired with | Closed-app alerts | The phone app says |
|---|---|---|
| A desktop, over Anywhere (the relay) | Yes, with no further step: the relay itself needs the installation credential, so the computer already has it | on |
| A Cloud (My Cloud or Team Cloud) | Yes, with no further step: the Cloud's Admin relays for it (see "Cloud homes") | on |
| A desktop on the same Wi-Fi only, never signed in | No: the computer has no account to push as. Turning Anywhere on (and signing in) is the one step; the phone's registration is already kept, and the first push after the sign-in registers it with the control plane | no-account ("Your computer isn't signed in to a MausBot account…") |
openmausbot serve on a person's own server |
Yes once it holds an installation credential: openmausbot account login, OMB_INSTALLATION_CREDENTIAL or OMB_PUSH_CREDENTIAL. Without one, as the row above |
on, or no-account |
A desktop that was ever signed in for Anywhere keeps its credential, so a phone paired with it over Wi-Fi gets pushes too. The pairing route does not matter; the computer's credential does.
On a Team Cloud each person's phone gets only the alerts that person's own
event stream would carry (their own private chats, rooms and bots they can
see), the same rule as the stream (pushReaches in server/index.ts, tested
in server/cloud-team-phone-push.e2e.test.ts). Live Activities and Android's
ongoing notification are not offered on a Team Cloud: a bot's state there
(working, waiting on an ask) is everyone's, not one person's, so it could show
one person another's private work. A Team Cloud keeps no activity token and
pushes no activity; closed-app alerts are unaffected.
Switching it off. features.phonePush: false in config.json, or
OMB_PHONE_PUSH=0 in the server's environment, turns it off on that machine
(only an exact 0 or 1 is read; 1 turns it on over a false in
config.json). This is an operator's kill switch; there is no setting or dialog
for it. A phone then hears off, and the server keeps nothing and calls nobody.
For every Cloud home at once, the Admin's OMB_CLOUD_PHONE_PUSH switch is the
kill switch: off, its relay routes answer 404 and homes back off for an hour.
A phone that registered while push was off. The server kept nothing then.
The phone app registers again at each connect while its last answer was off
or no-account, so after the desktop or Cloud updates its next connect stores
the registration and registers it with the control plane, with no step from the
person.
How it works
- The phone gets a device token. The app asks the system for its raw push
token (
Notifications.getDevicePushTokenAsync()in expo-notifications): a 64-character hex string on iPhone, an FCM registration token on Android. No third-party push service sits in between. - The phone gives the token to its computer or Cloud, over the link it
already uses and with the credential it already has:
PUT /api/push/device {platform, token, environment?, pairing, kinds, botChannels?, mutedBots?}. The server knows which phone is asking from what authenticated the request (the phone's paired session, or the device the desktop's companion vouched for), never from the body. The phone does this after it connects, whenever the token changes, and whenever the person changes a notification switch. - The server registers the token with the control plane
(
POST /v1/installations/self/push/register), using the installation credential it already holds for the hosted transport. A Cloud home, which has none, asks its Admin to relay the same call (see "Cloud homes"). The control plane holds the APNs key and the Firebase service account; servers and the Admin never do. - Something happens that would notify the person. The server emits its
notifyframe as today. For each registered phone, it checks:- is phone push switched on;
- is this one of the kinds a closed app is woken for: an approval, a
question, a sign-in request, or a finished reply (
done); - did this phone ask for this kind (its own Settings switches);
- does this phone hold a live event stream right now (then it gets the frame the normal way, and no push);
- would this phone have been shown this frame at all (the same audience rule the event stream uses: bot visibility, rooms, admin-only frames, a Team Cloud's per-person frames);
- has it had a push for the same kind and conversation in the last 10 seconds, or 60 pushes in the last hour (40 for a finished reply; see "Rate limits").
- The server asks the control plane to send
(
POST /v1/installations/self/push/send) with the kind, a title made from names, ids, the phone's tag for this computer, and a notification identifier. The send is queued in a small outbox: a failure the relay may recover from is retried after 5 s, 30 s and 2 min; a push still waiting after 10 minutes, or for a phone that connected in the meantime, is dropped. - The control plane sends it to APNs or FCM, which wake the phone.
- The phone shows it. On iPhone the system shows it. On Android expo-notifications shows it, in the same channel and with the same buttons as a local notification.
- A tap opens the app on that computer and conversation. The app connects and fetches the content as it always does. The buttons (Allow, Deny, Answer) work as they do on a local notification: they open the app, wait for the connection, and answer the card.
What a push contains
Never message text. The control plane's schema refuses any field that could
carry it (400 invalid_request, not silently dropped).
| Field | Example | Notes |
|---|---|---|
| kind | approval |
approval, question, sign-in, done |
| title | Scout needs approval |
the server's own notification line for that kind, from the bot's name only (never the room's), in the conversation's language |
| bot id, bot name | bot_…, Scout |
|
| thread id | th_… |
which conversation to open |
| room id, room name | grp_…, Launch |
only in a room; for the app once it is open, not on the lock screen |
| pairing | the phone's random tag for this computer | so a tap opens the right one of several saved computers |
| collapse id | openmaus.<thread>.<seq> |
see "No duplicates" |
What the lock screen reads, by kind:
- approval: "Scout needs approval" (in a room too: the room is left out)
- question: "Scout has a question"
- sign-in: "Scout needs you to sign in to a website" (the website is left out)
- finished reply: "Scout finished"
On iPhone the payload is {aps: {alert: {title}, sound, thread-id, category, interruption-level}, omb: {...}, body: {...}}. On Android it is a data-only
FCM message with title, tag, channelId, categoryId, threadIdentifier
and body (the same fields as JSON), and no message text. The exact shapes are
in cloudflare/control-plane/README.md ("Phone push relay").
A Live Activity push leaves alert unset. An activity update that carries
alert lights the screen and pops the activity open in the Dynamic Island,
which brings back the large expanded island the phone app removed (its own
activities send no alert configuration, so the island stays a small mark).
The person still hears about the ask: the closed-app alert above arrives as
an ordinary notification. Only a push-to-start start carries alert,
because ActivityKit does not start an activity remotely without one, and the
control plane refuses alert on anything else. A phone that registers its
status words (statuses) gets the activity in its content state version 1
(status, ask, waiting, version); a phone that does not gets the
earlier shape with headline, which the phone app also draws.
No duplicates with local notifications
A push goes only to a phone with no live stream, so most of the time only one of the two exists. They can meet at the edges: the app comes back and replays the frames it missed, or the stream closes just as an alert is sent.
- The push carries the identifier the app would give its own notification for
the same frame:
openmaus.<threadId>.<seq>. On iPhone this is the APNs collapse id, which becomes the notification's identifier; on Android it is the notification's tag. A local notification with the same identifier replaces the push instead of adding a second one. - The app also remembers which pushes it has seen (still in the notification centre, tapped, or received while open) and does not post a local notification with the same identifier.
- In the foreground, a push that arrives while the stream is live is not shown: the stream's own notification wins.
- If the identifier would be longer than 64 bytes (APNs' limit), the push falls back to one identifier per kind and conversation. That only happens for thread ids over 40 characters; MausBot's are shorter.
Privacy and threat model
What the control plane learns. For each registered phone: the installation that registered it (for a Cloud home: the home's machine id), the device token, its platform and APNs environment, and when it last got a push. For each send: the kind, the title, the bot's and room's names and ids, the thread id and the phone's pairing tag. It never sees message text, files or credentials. It logs only the request id, the platform and the provider's status and reason, never the token or the payload.
What the Admin learns (Cloud homes only). Which of its machines asked, when, and the action; and, in memory for the length of the call, the body it forwards: the device token, its platform and environment, and for a send the same names, ids and title as the control plane. It stores none of it: no token in its database or logs (its per-phone limit counts a hash keyed with a random key that dies with the process), and it logs only the machine, the action and a status.
What Apple and Google learn. The same names, ids and title, the device token, and when MausBot pushed to the phone. Not the content of any conversation.
Where tokens are kept. On the computer or Cloud, in
<data dir>/push-devices.json (mode 0600), beside the other paired-device
records. In the control plane, in the D1 table installation_push_devices
(token and its SHA-256), or for a Cloud home in machine_push_devices (the
same, keyed by the home's machine id). The phone app never sends the token
anywhere else.
GET /api/push/device never echoes it.
Revocation. A registration ends when:
- the phone removes the computer (the app calls
DELETE /api/push/devicefirst, while it can still reach it); - the computer signs the phone out, or its session expires
(
onSessionRevoked); - the desktop's companion unpairs the phone (
/api/live/device-revoked); - the same phone pairs again (the token moves to the new pairing);
- Apple or Google say the token is dead (
410), which deletes it everywhere; - the installation is revoked in the control plane, which deletes all its tokens;
- for a Cloud home, the Admin retires or deletes the Cloud: it asks the control
plane to delete every token of that machine (
.../push/forget), and keeps asking until it answers.
Known gap: a phone that removes a computer it cannot reach (the computer is off) leaves its registration there until one of the other events happens. The phone then still gets "Scout finished" from that computer; a tap opens nothing, because the computer is no longer saved.
Rate limits. On the server: one push per phone, kind and conversation in
10 seconds, and 60 pushes per phone an hour, alerts and Live Activity changes
together, the same as the control plane allows a token. Finished replies and
activity changes stop at 40 in that hour, so a bot looping finished replies
leaves the last 20 for approvals, questions and sign-ins. When the relay answers
429, only that phone is left alone for the wait it names (a minute) and only
its waiting pushes are dropped; every other phone's go on. In the control
plane: 600 sends per installation and 60 per token per hour, 120 registrations
per hour, 50 tokens per installation. A Cloud home gets 200 sends an hour (1% of
the fleet's), 60 per token, 120 registrations and 50 tokens, and every Cloud
home together 20,000 sends and 6,000 registrations an hour. The Admin applies
the same per-home and fleet limits before it forwards anything, and alerts its
operators once in an hour when the fleet reaches half of its sends.
With phone push on by default, every limit but the fleet's is per phone, per installation or per home, so more machines with push on do not bring any of them closer. Only phones that registered cost anything, and a phone sends an unchanged registration again only about once a day, so the registration limits are far off. The fleet's 20,000 sends an hour are shared by every Cloud home; with each home held to 1%, it takes a hundred homes at their own limit to use them all, and the Admin's alert comes at fifty.
Replay and forgery. Every relay call needs the installation credential. A send reaches only a token that the same installation registered, so a stolen credential of one computer cannot reach another computer's phones. It could send its own phones content-free alerts with a misleading title (up to 200 characters, one line) until it is revoked; that is the open risk of a stolen credential, bounded by the rate limits. Replaying a send gives a duplicate alert at most, replaced on screen by the collapse id. A paired phone can register only for itself; a phone that registered somebody else's token would only send that person the same names and ids it can already read.
A Cloud home signs each call to its Admin with its own bootstrap secret, over the machine id, the action, a timestamp (5 minutes), a nonce (once) and the body. The Admin takes the machine id from that signature, never from the body, so a compromised home can register and push only under its own machine id, which reaches only the tokens its own phones registered; it cannot reach another customer's phone. The Admin reaches the control plane with one secret shared only between the two. Whoever held that secret could push content-free alerts to any Cloud home's registered phones by naming machine ids, bounded by the per-token and fleet limits above, but could not read a token back or reach an installation's phones. It is rotated without downtime: the control plane accepts a previous secret beside the current one.
Cloud homes
A desktop has an installation credential once its owner turns on Anywhere
(Settings → Devices → How your phone reaches this computer → Anywhere, through MausBot),
and openmausbot serve has one after openmausbot account login or
from OMB_INSTALLATION_CREDENTIAL (or a push-only OMB_PUSH_CREDENTIAL). A
Cloud home has none. So the Admin relays for its homes, My Clouds and Team
Clouds alike, keyed by the home's machine id. It is live: the Admin's switch is
on.
- The home (
server/phone-push-admin.ts): when the server runs as a Cloud home and has no installation credential, every relay call goes to its Admin instead,POST <admin>/api/cloud/machines/push/{register,unregister,send,activity}, with the very same body, signed with the bootstrap secret it already holds (headersx-omb-cloud-machine,x-omb-cloud-timestamp,x-omb-cloud-nonce,x-omb-cloud-signature: v1=<HMAC-SHA256 over "omb-phone-push-v1", the machine id, the action, the timestamp, the nonce and the body's SHA-256>). Same outbox, retries and back-off:503 push_unavailable, a401or a404(an Admin with its switch off, or an older one) leaves it alone for an hour. On by default like every server;features.phonePush: falseorOMB_PHONE_PUSH=0on the home turns it off there. When the Admin refuses (404other thanpush_device_unknown, or503 push_unavailable), the home tells its phonesofffor that hour, so a phone shows its "hasn't turned on" line and registers again at each connect; once the hour is over the next registration tries the Admin again. The Admin does not writeOMB_PHONE_PUSHinto a home's environment. - The Admin checks the signature, takes the machine id from it, checks the
body against the control plane's own strict schemas (no field for message
text), applies the limits, and forwards the parsed body. Its switch is
OMB_CLOUD_PHONE_PUSH(a live switch, off when unset, on in production); it forwards toOMB_CLOUD_PUSH_RELAY_URLwithOMB_CLOUD_PUSH_RELAY_SECRET. Retiring or deleting a Cloud deletes its tokens at the control plane, switch on or off. - The control plane has the matching routes,
POST /v1/cloud-homes/<machine id>/push/{register,unregister,send,activity,forget}(src/push-cloud-homes.ts), beside the installation ones and with the same bodies, limits, storage shape (machine_push_devices, migration0019) and send path, plus a fleet-wide limit. They take only the Admin's secret,CLOUD_HOME_PUSH_SECRET(andCLOUD_HOME_PUSH_SECRET_PREVIOUSduring a rotation), compared in constant time; with neither set they answer503 push_unavailable. Nothing changes for installation callers.
The bodies both sides accept and refuse, and the home's signature, are one
fixture, cloudflare/control-plane/test/fixtures/cloud-home-push.json, which
the Admin holds byte for byte and checks with the same SHA-256.
No credential lives on the home beyond the bootstrap secret it already had, nothing needs rotating every 90 days, and the Admin keeps no device token.
Switching it on for Cloud homes, after steps 1 to 10 of "Switching it on", in order (all done; kept as the record and for a new environment):
- Apply the control plane's migration
0019_cloud_home_push.sql. - Set the control plane's
CLOUD_HOME_PUSH_SECRET(random, 32 characters or more) and deploy it. - Ship an Admin image with the relay, then set the same value as the Admin's
OMB_CLOUD_PUSH_RELAY_SECRET, andOMB_CLOUD_PUSH_RELAY_URLto the control plane's origin, and restart the Admin. - Ship a Cloud home image with this code. Homes have phone push on by
default; to keep one test Cloud apart, set
features.phonePush: falseon the others first (its owner'sPUT /api/config; anOMB_PHONE_PUSHset by hand in a home's environment is lost at its next update). - Turn
OMB_CLOUD_PHONE_PUSHon in the Admin's Cloud operations → Switches. - Run "Test plan on real devices" against a Cloud.
Always-on and the grace period
- iPhone. For about 25 seconds after the app leaves the screen it keeps its stream open and posts local notifications itself. When the stream closes, the server sees no live stream and pushes from then on.
- Android, Always-on off. The same, with the 25-second linger.
- Android, Always-on on. The stream stays open, so the server never pushes; local notifications work as today. Push is the fallback when the system or the phone maker kills the service.
- "Live stream" means an open
/api/eventsconnection from that phone. A stream a network box holds open after the phone went to sleep delays pushes until the server notices it is gone (the heartbeat, every 15 seconds, eventually fails).
Time-sensitive alerts and Android channels
- On iPhone, approvals, questions and sign-in requests are sent with
interruption-level: time-sensitive, so they break through Focus. That needs the Time Sensitive Notifications entitlement, which the phone app's preview and production builds carry (timeSensitiveNotificationsin itsapp.config.ts); a development build shows them as ordinary alerts. - On Android a push uses the app's existing channels:
approval_question(high importance) for approvals, questions and sign-ins, andbot_messagesfor finished replies. A phone that never opened the new app has no channels yet and shows the push in the default channel. - An Android phone can name the bots it made a channel of their own for
(
botChannels, ids). A push for one of those bots then goes out withbotChannel: true, and the control plane sends a finished reply onbot_messages.<botId>, where the person can give the bot its own sound. The server never names a bot the phone did not list, because Android shows a push for a missing channel under "Miscellaneous". A Cloud home leaves the field out, since its Admin's copy of the send schema does not take it yet, so its phones keep the sharedbot_messageschannel. The answer'sdevicelists the registeredbotChannels(empty when none) on a computer that takes the field; an older one answers without it, and the phone then leaves the list out, since that computer refuses fields it does not know. - A phone can mute single bots (
mutedBots, ids, on both platforms). The server then sends that phone no alert push for those bots (Live Activity and ongoing-notification updates still go); its other bots, and other phones of the same person, are not affected. A push already waiting for a retry is dropped once its bot is muted. The answer'sdevicelists the muted bots (empty when none) on a computer that takes the field, and the phone sends its list only to a computer that answers with it, as withbotChannels. - The categories (Allow and Deny on an approval, Answer on a question) are the ones the app registers today.
Compared with the reference app, and why push goes through the control plane
The owner asked for push "like the reference app does it, with a relay". This section says what the reference app actually does, how each part maps onto MausBot, and which design we keep.
How the reference app does it
- Who sends. The user's own server process, running on their machine, watches its own event stream and posts each conversation's state (phase, project and thread title, model name, timestamps, a deep link) to a hosted service it calls its relay: a Cloudflare Worker with a database. The server authenticates with a per-environment credential plus a short signed proof that can be used once. The hosted service never detects events itself.
- What the hosted service knows. Device tokens and preferences, the Live Activity tokens, which environments each account linked, and the per-thread state above: titles and phases, never message text (failure details are replaced with a fixed sentence). It fans each state out to every device of every account linked to that environment, through APNs (alerts and Live Activity updates) and FCM (data-only messages).
- When the user's machine is off. Nothing new is sent. The hosted service expires old rows (running after 2 hours, waiting after 24 hours, finished after 15 minutes) and a cron job ends idle Live Activities; the cards also go stale after 10 minutes.
- The phone. It registers once per account with a stable device id and the raw APNs or FCM token, re-registers when the token rotates, on every return to the foreground, and when a stored signature (token, app version, OS version, preferences) changes. Calls go one at a time, and a generation counter stops a late answer from overwriting a sign-out. Live Activities are always started on the phone, in the foreground; their update tokens are registered, and the hosted service updates and ends them by push. It does not start them by push: the reference app records that remote start proved too unreliable. On Android, a native module handles FCM data messages without a foreground service and shows one ongoing "agent activity" notification plus alerts.
How that maps onto MausBot
| The reference app | MausBot |
|---|---|
| The user's server watches its events and decides | The computer or Cloud (server/phone-push.ts) does the same |
| Hosted relay: holds the APNs and Firebase keys, stores tokens, sends | The control plane's push routes (cloudflare/control-plane/src/push.ts) |
| Server authenticates with an environment credential | The installation credential the computer already has |
| Device registration goes to the hosted relay, per account | Registration goes to each computer over the phone's existing link, and the computer registers it with the control plane |
| Live Activity tokens registered, updates and ends by push | The same (/api/push/activity, control plane push/activity) |
| Android ongoing notification from FCM data, no foreground service | The same (the phone app's bot-activity module) |
MausBot also has something called a relay: MausBot Relay (relay1, relay2,
relay/ in this repository). It is a different thing. It splices the phone's
end-to-end encrypted connection to the computer and cannot read a byte of it,
so it never sees an event, a bot name or a token. The reference app's relay is
a hosted service that receives plain state from the user's server and talks to
Apple and Google. In MausBot that service is the control plane.
Should push go through MausBot Relay as well, or instead?
What it would buy:
- The relay knows when a phone's link is down. So does the computer: the relay's view is the same session the computer holds, seen from the middle. The computer also knows when a phone on Wi-Fi or a tunnel is gone, which the relay never sees.
- One hosted hop. We already have one: computer → control plane → Apple or Google. Going through the relay would add a hop (computer → relay → Apple), because the relay would still have to learn what to send from the computer.
- Fewer moving parts. It would be more. The relay nodes are long-running containers on two hosts, built to carry bytes they cannot read. They would need the APNs key and the Firebase service account on each node, a token store, rate limits and dead-token handling. That is a second sender to secure and keep in step with the control plane, which already does all of this and is covered by tests.
What it would cost or break:
- Cloud homes and many phones never touch the relay. A Cloud is reached directly over HTTPS, and many phones use Wi-Fi or a tunnel. Only the control plane can serve them all.
- It weakens what the relay promises. Today a relay compromise exposes only ciphertext and connection metadata. With push it would also expose device tokens and the keys that can alert every MausBot phone.
- Credentials would sit outside Cloudflare's secret store, on hosts we patch ourselves.
Recommendation: keep the control plane as the sender. It already is our equivalent of the reference app's relay: a single hosted service that holds the Apple and Google keys, receives content-free state from the user's own machine, and sends. MausBot Relay stays a blind splice. What we take from the reference app is everything around the sender: the phone's registration robustness, Live Activities updated and ended by push from tokens the phone registers, and an ongoing "working" notification on Android driven by FCM data messages. MausBot keeps one difference on purpose: the phone registers with each computer, not with a hosted account, because a phone can be paired without any MausBot account at all.
Switching it on
What the owner provides and does, in order. Done for iPhone: the control plane sends with the Apple key, the Admin relays for Cloud homes with its switch on, the iPhone build 2.0.1 registers, and servers have phone push on by default (step 10). Android does not have push yet. The steps stay as the record and for a new environment.
Apple
- In the Apple Developer account, create an APNs auth key (
.p8) with the Apple Push Notifications service enabled. Note its Key ID and the Team ID. - Enable the Push Notifications capability on the App ID
com.openmausbot.app(and.next/.devif those builds should get pushes), then regenerate the provisioning profiles.
- Create a Firebase project, add the Android app
com.openmausbot.companion(and the.next/.devpackages if wanted), and downloadgoogle-services.json. - In Project settings → Service accounts, generate a private key (the service-account JSON). It needs the Firebase Cloud Messaging API (V1) enabled.
Control plane (cloudflare/control-plane/README.md, "Phone push relay")
- Apply the D1 migrations
0017_push_platforms.sql(after0008) and0018_push_purpose.sql(Live Activity and push-to-start tokens). Live Activities and Android's ongoing notification need no further secret: they use the same APNs key (topic<bundle id>.push-type.liveactivity) and the same Firebase project. - Set the secrets:
APNS_KEY_ID,APNS_TEAM_ID,APNS_PRIVATE_KEY(the.p8),APNS_BUNDLE_ID(com.openmausbot.app), optionallyAPNS_ENVIRONMENTS=production,sandboxto accept development builds, andFCM_SERVICE_ACCOUNT(the whole service-account JSON). - Deploy the Worker. Until a platform's secrets are set its routes answer
503 push_unavailableand servers back off for an hour.
Phone app (app/app.config.ts in the phone repository)
- Put
google-services.jsonwhere the build can read it (an EAS file secret named byMAUSBOT_GOOGLE_SERVICES_FILE, orapp/google-services.json). - Build with
MAUSBOT_REMOTE_PUSH=1(or setREMOTE_PUSH = true). This adds theaps-environmententitlement (productionfor preview and production builds,developmentfor development builds), Firebase on Android, and turns on token registration in the app. Update the store privacy answers (the app now sends a device token to MausBot's servers and to Apple or Google).
Desktop and server
- Ship the server with phone push. It is on by default for anyone who pairs
(see "Who gets it");
features.phonePush: falseinconfig.jsonorOMB_PHONE_PUSH=0turns it off on one machine, andOMB_PHONE_PUSH=1turns it on over afalse. There is no setting for it. - For Cloud homes, follow "Switching it on for Cloud homes" under "Cloud homes".
Deploy order: migration and secrets, then the control plane, then a phone build with the switch on, then servers (on by default).
Test plan on real devices
Run each on an iPhone (TestFlight build, production APNs) and an Android phone (release build with Google Play services, once it has push), paired with a desktop that has Anywhere on (signed in), or with a Cloud. No switch is needed.
- Pair, then
GET /api/push/devicefrom the phone (or check the server'spush-devices.json) shows a registration with the right platform. - Lock the phone for a minute. Ask a bot to do something that needs approval. A notification "Scout needs approval" arrives within seconds, with Allow and Deny.
- Tap Allow on the lock screen: the app opens, connects and answers the card.
- Swipe the app away. Send a message to a bot; "Scout finished" arrives. Tap it: the app opens that conversation.
- With the app open on screen, trigger an approval: exactly one notification (the local one), no push.
- Leave the app and come back within 25 seconds while a reply finishes: one notification, not two.
- Turn off "Approvals and questions" in Settings: approvals stop arriving while closed; finished replies still arrive.
- Remove the computer in the app's Settings: no more pushes from it.
- Two saved computers: a push from the one that is not active opens on that computer after a tap.
- Android with Always-on on: no pushes (local notifications only); force-stop the service and pushes resume.
- Uninstall the app, trigger an alert: the server log shows the token
dropped after the provider's
410/UNREGISTERED. - A computer with phone push switched off (
features.phonePush: falseorOMB_PHONE_PUSH=0): nothing in the control plane's logs,GET /api/push/devicesaysoff. - A desktop paired only over Wi-Fi and never signed in: the phone's footer says the computer isn't signed in to a MausBot account; turn Anywhere on, lock the phone, trigger an approval: the push arrives.
What this does not do
- No message previews. The notification shows the bot's name and what it needs, never the message. Showing text would need the phone to open the encrypted link from a notification extension, which is not planned.
- Nothing arrives if the computer is off or asleep, or offline. The computer is what notices the event and asks for the push; a sleeping Mac notices nothing. A Cloud runs all the time, so a Cloud's phones get pushes whenever its bots work (its Admin relays for it, see "Cloud homes").
- No push for other kinds (mentions, routine failures, waits, notices). They arrive as today while the app is connected.
- No badge counts from push. The badge is updated when the app runs.
- No delivery guarantee. Apple and Google may delay or drop a push (low battery, Focus, Doze); the outbox retries only failures between the server and the control plane.