feat(notifications): add webhook and email notification support #118
No reviewers
Labels
No labels
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
thwap/kronai!118
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/0071-add-webhook-notification-support"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Add webhook and email notification support for job completion events. Webhooks POST JSON payloads to a configurable URL. Email alerts send via SMTP with TLS and optional auth.
Why
Users need to be notified when jobs complete or fail, either via webhook integration or email.
Testing
Breaking Changes
None.
Notes
Notification config in
[notifications]section withwebhook_url,smtp_*fields, andon_failure_onlyflag.Closes #0069
Closes #0070
Closes #0071
Automated Review — PR #118
Result: APPROVED
The final PR on the ROADMAP. Webhook and email notification support rounds out the feature set. Clean implementation.
send_webhookPOSTs JSON, checks HTTP 400+.send_emailsupports STARTTLS + optional auth.notify()dispatches both channels independently, respectson_failure_only, and logs errors without blocking job execution._build_payloadcreates structured event data.NotificationConfigdataclass added, config merging handles nested dataclass, engine wired up on MCP error / LLM error / success paths.send_webhook/send_emailseparated from dispatch logic. Engine test refactored with_mock_config()helper (nice dedup).Suggestions (non-blocking)
src/kronai/notifications.py:100-108—send_emailonly supports STARTTLS (port 587). No implicit TLS (SMTP_SSL, port 465). Consider addingsmtp_use_sslconfig flag that usessmtplib.SMTP_SSLinstead.src/kronai/notifications.py:69-76—send_webhookhas no retry logic. Unlike the LLM client (which has exponential backoff), transient webhook failures are silently logged. Consider adding retry with backoff for transient failures.src/kronai/engine.py:65— Config is loaded insiderun_job()but also inrun_interval(). For an interval of N jobs, config is loaded N+1 times. Consider passing config fromrun_interval()torun_job()(building on the earlier refactor that moved config load earlier in this PR).