Notify: an agent's notify reaches every connected app

The notify tool now records a chat_notify app notification with its own
id per call (no dedupe of repeated words) and the tool's priority, so
every subscribed client gets it and a reconnecting client replays it.
ntfy delivery is unchanged; the tool result names where it went.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-02 15:44:39 +00:00
parent 3e817a189b
commit c8541f29b7
11 changed files with 195 additions and 47 deletions
+7 -3
View File
@@ -242,10 +242,14 @@ N = {"id":"run:7:3:waiting","kind":"run_waiting","title":"Run needs your decisio
- `id` is stable: `run:<run>:<step>:<event>` (event `waiting`, `failed`,
`succeeded`, or `success` for a mid-run stage hook) or
`chat:<session>:<form|permission|reply>:<id>`. `kind` is one of `run_waiting`,
`chat:<session>:<form|permission|reply|notify>:<id>`. `kind` is one of `run_waiting`,
`run_failed`, `run_succeeded`, `stage_failed`, `stage_succeeded`,
`chat_question`, `chat_approval`, `chat_reply`. `group` is `run:<id>` or
`chat:<id>`. `priority` is 3 and `tags` empty, matching what ntfy receives.
`chat_question`, `chat_approval`, `chat_reply`, `chat_notify`. `group` is `run:<id>` or
`chat:<id>`. `priority` is 3 and `tags` empty, matching what ntfy receives,
except `chat_notify`: an agent's `notify` tool call, whose priority is the
tool's (`low` 2, `default` 3, `high` 4). Every subscribed client receives it,
whichever chat it shows; the web app posts it as a browser notification or an
in-app alert, so an agent's notify reaches the operator without ntfy.
- The subscribe reply holds the active (uncleared) notifications newer than the
`after` cursor (the last id the client holds), oldest first, at most 100;
an empty, unknown or pruned cursor replays them all. Its `ids` lists