It is 9pm, you are typing on your laptop, and your phone buzzes again

It is 9pm. You are at your desk debugging a scheduler with Hermes, phone face-down next to the keyboard. The reply lands, you read it, and the phone buzzes anyway — the same answer, pushed a second time. You swipe it away and keep typing. Then you walk off to make tea, and this time nothing arrives, even though that was the one reply you actually needed on your phone.
Nothing was missing from the notification pipeline. What was missing were two facts any notifier needs: which device you typed that message on, and whether you are still sitting there. Hermes knew the session and the profile, but not whether a message came from the desktop app, the Webapp or a phone, and not whether you had just walked away. So every notification plugin could only guess: push everything, or push nothing.
Two PRs close that gap — #158407 on the gateway, #158424 on the desktop side. Both are strictly attribution: they grant no permissions, change nothing the model sees, and change no app’s current behaviour.
What this is not
- Not phone support. Phones could always send messages; now each turn carries a label saying where it came from.
- Not a notification switch. Hermes does not push to your phone. Whether a plugin notifies you, and when, stays the plugin’s decision.
- Not a behaviour change. Desktop and Webapp work exactly as before; they just say two extra things when they connect.
In other words: raw material for plugin authors. Material carries no policy, which is both the restraint and the safety story.
Three pieces: a hello, a stamp, a presence report
1. The client says what it is
A client names itself on the existing client.capabilities call:
{ "name": "hermes-desktop", "version": "0.23.3", "kind": "desktop" }
- Known kinds are
desktop,webapp,tuiandmobile. - An unknown kind is not an error: the name is kept and the kind dropped, so shipping a new client never requires a server release.
- Desktop sends
hermes-desktop/desktop; the Webapp sendshermes-webapp/webapp. versionis the install’s own; the hello waits at most one second for it and otherwise goes without.
2. Every turn gets a stamp
When an announced connection submits a turn, the session authority copies that label into the admission’s committed surface_v1.client.
Two details deserve their own paragraph:
prompt.submitgains no wire field. The origin is not a parameter the client asserts at submit time.- A client that puts a
clientparameter intoprompt.submitis still rejected withinvalid_params.
The intent is obvious once you think about abuse: attribution must come from the connection’s identity, not from a field inside the message. Otherwise any client could claim to be the desktop app, and a notifier would happily conclude you are at your desk.
3. Presence
The gateway keeps, per connection and per session, the time of your last input. In memory only. Two feeds:
Input the gateway sees itself — submit, steer, interrupt, approval answers, and a person’s accepted answer to a question, sudo, secret, vault or picker prompt.
A report the client sends:
{
"sessions": ["<session-id>"],
"idle_seconds": 12,
"basis": "system",
"can_alert": true,
"away": false
}
sessions: the conversations this window is showing, at most 16 ids, each at most 256 characters.idle_seconds: how long ago your last input was.basis:system(the OS idle clock) orpage(input inside the Hermes window).can_alert: whether this connection can get your attention itself.away: screen locked, machine suspended.
The report and the gateway’s own view are compared when read, and the newer one wins. A report that arrives late therefore cannot overwrite input the gateway just watched happen.
“A report is the whole statement” — the rule people misread
A report is not an incremental update; it is the connection’s complete claim about the present:
- every session the report does not list is dropped for that connection, including input the gateway saw itself;
sessions: []withdraws everything;away: trueclears everything immediately.
Why so absolute? Because when you switch from conversation A to B, or open Settings, the honest statement is “I am showing B now”. Incremental semantics would require every client to remember what it said last time; forget once and you leave behind a claim that never expires — and that claim silences a phone forever.
The same logic explains another limit: once a connection is no longer attached to a session, its report for that session is dropped. No zombie presence.
How the desktop decides you are still there
This is PR #158424, and it is the part that has to be honest about differing evidence.
Main process (Electron):
- On macOS and Windows it reads the OS idle clock (
powerMonitor.getSystemIdleTime()), so working in another app still counts as being there. - It tracks lock, unlock, suspend and resume on every platform.
- It pushes a snapshot when you come back, every 45 seconds while you stay, and immediately on lock or suspend.
- It pushes nothing while you are idle. Silence is safe because the server ages a report on its own.
Linux has no trustworthy clock. Wayland hides it; under X11 Hermes itself resets it after every reply. So on Linux the main process reports “no system source” and falls back to the weaker evidence.
Renderer (Desktop and Webapp): one small reporter per window, reporting only for the conversation currently on screen in the chat view. Evidence is the OS idle time when the main process has it (basis: "system"), otherwise pointer, key, wheel and touch input inside a visible document (basis: "page"). Focus and visibility are never evidence by themselves — a window in front is not a person.
Reporting is conservative too:
- only while the newest input is under a minute old, then at most every 45 seconds;
- coming back is noticed at once when your first input is in the Hermes window, and within 15 seconds when it is in another app;
- changing the conversation on screen, or switching to any non-chat page such as Settings, withdraws the claim immediately.
In the desktop app, Settings → Notifications carries a row called “This computer for phone notifications” that shows what Hermes is currently being told, e.g. “While a conversation is open in this window, Hermes is told when you last used this computer. Last input 12s ago.” It is a readout, not a switch: it is exactly what the server hears right now.
Reading it from a plugin
Two accessors:
from hermes_cli.plugin_session import turn_client, session_viewers
label = turn_client() # {"name": "hermes-desktop", "kind": "desktop", ...}, or None
viewers = session_viewers() # connections attached to this session, with their idle data
Inside plugin context, ctx.turn_client() and ctx.session_viewers() work the same way.
A real policy looks roughly like: if this turn came from the desktop app, that connection’s idle time is under 60 seconds, and can_alert is true, skip the phone notification; otherwise send it. The policy lives in the plugin. The facts now come from Hermes.
Practical notes
- Presence requires a WebSocket. An owner must list the
client-activity-v1capability, and the gateway then answersclient.capabilitieswithclient_activity: true; stdio connections answerfalse. - Reports are keyed by session id, not by profile. On a socket serving several profiles, a report counts for the profile whose session of that id the connection is attached to — and for none while it is attached to same-id sessions in more than one profile.
- Memory only. Presence resets when the gateway restarts and clients re-report; stale presence would be worse than none.
- Old clients are unaffected. A connection that never reports simply has no presence data, so a plugin reads “unknown” rather than a false “here”.
The point
Bad notifications are rarely a broken delivery channel. Usually the system just does not know where the person is. With a source label and a presence report, Hermes still does not decide anything for you — it finally hands over the facts the decision needs.
If you build notification or attention tooling, the attention and notifications guide and background notification batching are the natural next reads. If you care about bots messaging each other rather than people, that is a different path: peer bot-to-bot DMs.