feat: add webhook support for push notifications - #101
Conversation
Code ReviewSummaryThis PR adds HTTP webhook support for real-time event delivery, including Issues FoundCriticalNone Important
Suggestions
VerdictREQUEST_CHANGES - Missing guide.md documentation for the new API (required per CLAUDE.md), and verbose docstring violates project conventions. The webhook implementation itself is well-structured with good test coverage for the core functionality. Automated review by Claude Code |
Add HTTP webhook support for real-time event delivery instead of polling. Features: - register_webhook MCP tool with channel/event_type filtering - Optional HMAC-SHA256 signing with shared secret - Async non-blocking dispatch with retries - CLI commands: webhook register/list/unregister - Prefix matching for channels (e.g., 'session:' matches all sessions) Storage: - New webhooks table (schema version 3) - Webhook CRUD operations - Smart matching for channel and event type filters Testing: - 16 new tests for webhook functionality - All 279 tests passing
- Add exception callback for background webhook dispatch tasks - Use threading instead of blocking asyncio.run() in fallback path - Narrow exception catching to httpx-specific errors (TimeoutException, RequestError) - Log exception details from asyncio.gather results - Add webhook documentation to guide.md - Add MCP tool tests, integration tests, and retry behavior tests - Clean up webhooks between tests in conftest Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
89a7f6e to
7c55119
Compare
Code ReviewSummaryThis PR adds HTTP webhook support for real-time event push notifications. It includes Issues FoundCriticalNone Important
Suggestions
VerdictREQUEST_CHANGES - The verbose docstring in Automated review by Claude Code |
Address PR reviewer feedback: - Use module-level httpx.AsyncClient with _get_webhook_client() for connection pooling - Trim verbose docstrings (remove Returns sections, keep minimal arg descriptions) - Fix test mocks to use new _get_webhook_client pattern Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Feedback AddressedImplemented
Skipped
🤖 Generated with Claude Code |
Code ReviewSummaryThis PR adds HTTP webhook support for real-time event push notifications, including Issues FoundCriticalNone ImportantNone SuggestionsNone Previously Addressed (Filtered)
VerdictAPPROVE - Code looks good, no issues found. All prior feedback has been addressed. The implementation is clean, well-documented, and thoroughly tested. Automated review by Claude Code |
Summary
Add HTTP webhook support for real-time event delivery instead of polling.
Features
register_webhookMCP tool with channel/event_type filteringwebhook register/list/unregistersession:matches all session events)Usage
MCP
CLI
Payload
{ "event_id": 123, "event_type": "task_completed", "payload": "...", "session_id": "abc", "timestamp": "2026-01-31T08:00:00", "channel": "all" }With secret configured, includes
X-Event-Bus-Signature: sha256=<hmac>header.Changes
storage.py: AddedWebhookdataclass, webhooks table, CRUD methodsserver.py: Added webhook MCP tools + async dispatch on publishcli.py: Addedwebhooksubcommand grouppyproject.toml: AddedhttpxdependencyUse Case
This enables agents like Clawdbot to receive real-time notifications when events are published to the bus, instead of polling.