Skip to content

Notifications

SAM combines an in-app notification center with optional Web Push delivery for agent progress and activity.

TypeUrgencyWhen It Fires
task_completeMediumA task finishes executing successfully (includes PR URL or branch name)
needs_inputHighAn agent calls request_human_input because it needs your decision
errorHighExecution fails with an error
progressLowAn agent reports incremental progress via update_task_status
session_endedMediumA conversation-mode session turn completes
pr_createdMediumAn agent creates a pull request
cron_failureHighA five-minute operational recovery sweep fails (active superadmins only)

Notifications are delivered via WebSocket for instant updates. The notification bell in the UI header shows the unread count and updates in real-time without page refresh.

Web Push is available for medium- and high-urgency notifications. Enable it under Settings → Notifications to receive agent questions and task results even when SAM is closed. Push on means the browser receives every eligible notification; SAM does not suppress phone delivery merely because another browser tab is connected. Low-urgency progress updates remain in-app only.

SAM uses one standards-based Declarative Web Push payload for Safari, Chrome, and Firefox. On iPhone and iPad, install SAM to the Home Screen before enabling push. Other supported browsers can enable push directly. Browser permission is requested only after you select Enable push, never on page load.

Agents can signal when they need your input using the request_human_input MCP tool. This creates a high-urgency notification that appears immediately.

The agent specifies:

  • A question describing what input is needed
  • A category: decision, clarification, approval, or error_help
  • Optional choices the user can select from (up to 10 options)
  • Context about the current state (up to 4,000 characters)

The tool call is non-blocking: the agent records the request and can stop its turn while SAM waits for your answer. Ordinary typed replies continue to resolve the request. When the agent supplies choices, the notification also renders touch-sized answer buttons; choosing one records the exact answer and forwards it to the agent.

SAM sends bounded reminders during the initial response window. At the original deadline, work is failed and its workspace is stopped only when push delivery was confirmed. If no out-of-band channel confirmed delivery, SAM extends the request instead. A hard maximum residence time still guarantees eventual termination. The separate agent-liveness reconciliation watchdog retains its existing destructive deadline.

When agents call update_task_status, SAM creates progress notifications. To avoid notification fatigue, these are batched: only one progress notification per task per 5-minute window (configurable via NOTIFICATION_PROGRESS_BATCH_WINDOW_MS).

EndpointMethodDescription
/api/notificationsGETList notifications (paginated)
/api/notifications/unread-countGETGet unread count
/api/notifications/:id/readPOSTMark as read
/api/notifications/read-allPOSTMark all as read
/api/notifications/:id/dismissPOSTDismiss a notification
/api/notifications/preferencesGETGet notification preferences
/api/notifications/preferencesPUTUpdate preferences
/api/notifications/push/subscriptionsPOSTAdd or refresh this browser’s push subscription
/api/notifications/push/subscriptionsGETList the user’s push subscriptions
/api/notifications/push/subscriptionsDELETERemove this browser’s push subscription
/api/notifications/wsGETWebSocket for real-time delivery
/api/config/vapid-public-keyGETRead the deployment’s public VAPID key
/api/projects/:projectId/sessions/:sessionId/attention/:markerId/resolvePOSTRecord and forward a structured answer

SAM automatically deduplicates notifications:

  • task_complete notifications are deduplicated within a 60-second window (configurable via NOTIFICATION_DEDUP_WINDOW_MS)
  • Progress notifications are batched per task per 5-minute window
  • cron_failure notifications are throttled per sweep name. KV provides the expiring coarse marker, and an atomic per-user Notification Durable Object claim guarantees that overlapping cron invocations do not send duplicates.

Operational sweep failures are sent only to active superadmin accounts. System and anonymous-trial sentinel users are excluded. The notification links to the admin log viewer for investigation and respects the recipient’s in-app cron_failure preference.

  • Maximum notifications per user: 500 (configurable via MAX_NOTIFICATIONS_PER_USER)
  • Auto-delete age: 90 days (configurable via NOTIFICATION_AUTO_DELETE_AGE_MS)
  • When the limit is reached, the oldest notifications are automatically removed
VariableDefaultDescription
NOTIFICATION_PROGRESS_BATCH_WINDOW_MS300000 (5 min)Minimum interval between progress notifications per task
NOTIFICATION_DEDUP_WINDOW_MS60000 (60s)Dedup window for task_complete notifications
NOTIFICATION_AUTO_DELETE_AGE_MS7776000000 (90 days)Auto-delete threshold
MAX_NOTIFICATIONS_PER_USER500Max stored notifications before oldest are removed
NOTIFICATION_PAGE_SIZE50Default page size for notification list
CRON_FAILURE_NOTIFICATION_THROTTLE_MS3600000 (1 hr)Per-sweep superadmin alert throttle
CRON_FAILURE_NOTIFICATION_KV_PREFIXcron-failure-notificationKV prefix used for coarse throttle markers and atomic deduplication keys
HUMAN_INPUT_TIMEOUT_MS7200000 (2 hr)Initial needs-input response window
HUMAN_INPUT_ESCALATION_FRACTIONS0.25,0.75Fractions of the initial window at which reminders fire
HUMAN_INPUT_UNDELIVERED_GRACE_MS7200000 (2 hr)Extension when no push delivery was confirmed
HUMAN_INPUT_MAX_WAIT_MS86400000 (24 hr)Hard maximum needs-input marker lifetime
WEB_PUSH_TTL_SECONDS86400Push-service message TTL
WEB_PUSH_VAPID_TTL_SECONDS43200VAPID authorization-token lifetime
WEB_PUSH_DELIVERY_TIMEOUT_MS10000Per-attempt push-service timeout
WEB_PUSH_DELIVERY_BUDGET_MS25000Total fan-out budget, hard-capped at 25s below Worker background lifetime
WEB_PUSH_FANOUT_CONCURRENCY8Maximum concurrent endpoint deliveries
WEB_PUSH_MAX_ATTEMPTS3Bounded attempts for transient failures
WEB_PUSH_MAX_RETRY_AFTER_SECONDS30Maximum honored Retry-After delay
WEB_PUSH_MAX_PAYLOAD_BYTES3500Maximum unencrypted payload size
WEB_PUSH_FAILURE_THRESHOLD5Consecutive failures before disabling a subscription
WEB_PUSH_MAX_SUBSCRIPTIONS_PER_USER8Maximum retained browser endpoints per user
WEB_PUSH_USER_AGENT_MAX_LENGTH512Maximum stored browser description length
RATE_LIMIT_PUSH_SUBSCRIPTION30Subscription mutations per user per hour