Notifications: agent notify reaches every device and clears everywhere
- Server: chat ntfy messages carry a sequence id derived from their app id; clearing a chat app notification also clears it in ntfy (PUT /<topic>/<seq>/clear, verified on ntfy v2.38.1). - Server: a turn that sent an agent notify does not also send chat_reply. - notify tool and MCP instructions: Pipelines already notifies at reply end and for questions/approvals; notify is for mid-turn or background news. - Shown notify items carry channels (apps/phone); the transcript row says where it went. - App: NotificationBridge.close(tag); web closes tracked Notifications and tells other tabs over a BroadcastChannel; native bridge cancels by tag and now supports macOS. AgentNotices closes on notifications_cleared and on resubscribe cleared ids, and a tap sends clear_notifications. - Docs: skill, chat reference, ntfy/notifications docs, app note. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
@@ -58,6 +59,11 @@ func newNtfyCapture(t *testing.T) func() []ntfyCapture {
|
||||
var mu sync.Mutex
|
||||
var got []ntfyCapture
|
||||
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if strings.HasSuffix(r.URL.Path, "/clear") {
|
||||
// A cleared chat notification's ntfy clear, not a delivery.
|
||||
_ = json.NewEncoder(w).Encode(map[string]string{"id": "clr", "event": "message_clear"})
|
||||
return
|
||||
}
|
||||
decoder := new(mime.WordDecoder)
|
||||
title, _ := decoder.DecodeHeader(r.Header.Get("Title"))
|
||||
message, _ := decoder.DecodeHeader(r.Header.Get("Message"))
|
||||
|
||||
Reference in New Issue
Block a user