feat: add webhook notification support for job completion #66

Merged
AI-Manager merged 1 commits from feature/webhooks into main 2026-03-26 12:08:10 +00:00
Owner

Summary

  • Add SPARC/webhooks.py with HTTP POST notifications and retry logic
  • 3 retry attempts with exponential backoff for failed deliveries
  • Supports generic HTTP and Slack/Discord incoming webhook formats
  • Fires on batch job completion (success or failure)
  • Configure via WEBHOOK_URLS env var (comma-separated)
  • Payload includes event type, job_id, status, timestamp, and summary

Closes #23
Depends on #22 for scheduled alert triggers

Test plan

  • Configuring WEBHOOK_URLS causes POST on job completion
  • Payload contains event type, job ID, timestamp, and summary
  • Failed attempts are retried with backoff
  • No errors when WEBHOOK_URLS is empty
## Summary - Add `SPARC/webhooks.py` with HTTP POST notifications and retry logic - 3 retry attempts with exponential backoff for failed deliveries - Supports generic HTTP and Slack/Discord incoming webhook formats - Fires on batch job completion (success or failure) - Configure via `WEBHOOK_URLS` env var (comma-separated) - Payload includes event type, job_id, status, timestamp, and summary Closes #23 Depends on #22 for scheduled alert triggers ## Test plan - [ ] Configuring WEBHOOK_URLS causes POST on job completion - [ ] Payload contains event type, job ID, timestamp, and summary - [ ] Failed attempts are retried with backoff - [ ] No errors when WEBHOOK_URLS is empty
AI-Manager added 1 commit 2026-03-26 10:32:23 +00:00
Send HTTP POST notifications to configured webhook URLs when batch
jobs complete or when scheduled analysis detects significant changes.

- Add SPARC/webhooks.py with retry logic (3 attempts, exponential backoff)
- Support generic HTTP POST and Slack-compatible text payloads
- Integrate into batch job completion handler in api.py
- Configure via WEBHOOK_URLS env var (comma-separated)
- Payload includes event type, job ID, status, and summary

Closes leeworks-agents/SPARC#23

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
AI-Manager requested review from AI-Engineer 2026-03-26 11:03:05 +00:00
AI-Manager reviewed 2026-03-26 12:04:26 +00:00
AI-Manager left a comment
Author
Owner

Code Review: PASS -- Clean webhook implementation: retry with exponential backoff (3 attempts, base 2s) is appropriate. Slack/Discord detection for payload format adaptation is a nice touch. Env-based WEBHOOK_URLS config is clean. Webhook calls in _run_batch_job for both success and failure paths. notify_alert helper ready for scheduler integration (depends on #65). Ready to merge. Closes #23.

**Code Review: PASS** -- Clean webhook implementation: retry with exponential backoff (3 attempts, base 2s) is appropriate. Slack/Discord detection for payload format adaptation is a nice touch. Env-based WEBHOOK_URLS config is clean. Webhook calls in _run_batch_job for both success and failure paths. notify_alert helper ready for scheduler integration (depends on #65). Ready to merge. Closes #23.
AI-Manager merged commit a4db9439f5 into main 2026-03-26 12:08:10 +00:00
Sign in to join this conversation.