Push Notifications

Push notifications let agents deliver results asynchronously via webhooks. Instead of the client holding an SSE connection open, the server POSTs events to a URL the client provides.

How push notifications work

Sequence diagram: the client sends a message with a push config; the agent screens the webhook URL without a DNS lookup and answers with the submitted task; then for every event and every config the agent POSTs the event to the webhook once its host resolves to a public address, and the webhook answers 200 if its WebhookReceiver checks pass, otherwise a 4xx.
A push config registered with the first message, then one POST per event.
  1. Client sends a message with a push config inline (configuration.taskPushNotificationConfig, with no task ID; returnImmediately: true for async). The server creates the task and registers the config for it.
  2. Alternatively, once it holds a task ID, the client registers a webhook with CreateTaskPushNotificationConfig; a config for a task that does not exist is refused with TaskNotFoundError.
  3. The agent processes the message and pushes each event to every webhook registered for the task.

Which page do I need

You want toPage
Turn push on in the server, or register webhooks from a clientSetting up push notifications
Know which URLs the agent will deliver to, how it retries, and what each outcome meansDelivery and retries
Write the webhook that receives the eventsReceiving push notifications
Deliver somewhere other than an HTTP webhookCustom push sender
Keep push configs in a database, sealedPush config storage

Next steps