Overview
Push notifications enable agents to send real-time task updates to your webhook endpoint instead of requiring polling. Handler provides:- A webhook server to receive notifications
- CLI commands to configure push notification settings on agents
- Automatic notification storage and display
How Push Notifications Work
When you configure a push notification webhook for a task:- Register webhook: You provide a webhook URL and optional token to the agent
- Agent stores config: The agent saves your webhook configuration
- Task updates: When the task state changes, the agent POSTs updates to your webhook
- Handler receives: Your webhook server receives and displays notifications
Starting the Webhook Server
- Basic Usage
- Custom Host/Port
- Behind Reverse Proxy
Start the webhook server on default port 9000:Output:
webhook.py:144-178:
Configuring Push Notifications
Notification Format
Notifications are stored with full context:webhook.py:66-110
Webhook Authentication
Protect your webhook with tokens:- Setting Token
- Validating Token
Configure the webhook with a token:The agent includes the token in requests:
Managing Notifications
- List Received
- Clear Stored
- Storage Limits
View all received notifications:Response:Implementation in
webhook.py:119-135:Getting Push Configuration
Retrieve the current webhook configuration for a task:service.py:571-593
Using with MCP Server
Configure push notifications through the MCP server:Public Webhook Deployment
For production use with public URLs:Checking Agent Support
Verify push notification support in the agent card:service.py:314-319
Troubleshooting
Webhook not receiving notifications
Webhook not receiving notifications
Check connectivity:Verify configuration:Check agent logs for webhook delivery attempts.
Connection refused errors
Connection refused errors
Ensure webhook server is running:Check firewall rules:
Agent returns 'not supported'
Agent returns 'not supported'
The agent doesn’t support push notifications:If
false, use polling with handler task get instead.Best Practices
Use Authentication
Always set a webhook token for production webhooks.
HTTPS in Production
Use HTTPS URLs for webhooks to protect notification data.
Monitor Storage
Clear notifications periodically to prevent memory buildup.
Handle Retries
Agents may retry failed webhook deliveries - ensure idempotency.