[FEAT] #512: Slack Integration for Smart Alerts via alert_smart_alert()#525
[FEAT] #512: Slack Integration for Smart Alerts via alert_smart_alert()#525adityakryadav wants to merge 2 commits into
Conversation
|
Warning Review limit reached
Next review available in: 58 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🧪 PR Test Results
Python 3.12 · commit 9e9c14b |
…rt_alert and format engine.py
|
@adityakryadav is attempting to deploy a commit to the sreerevanth's projects Team on Vercel. A member of the Team first needs to authorize it. |
sreerevanth
left a comment
There was a problem hiding this comment.
Thanks for the contribution! I like the direction of adding Slack notifications, but I don't think this PR is ready to merge yet.
A few things I'd like to see addressed before merging:
This introduces a new public alerting feature but doesn't include any dedicated tests. Please add unit tests covering the Slack payload generation, successful delivery, and the behavior when no Slack webhook is configured.
alert_smart_alert() is very specific to a single feature. Since this lives in the shared alerting engine, I'd prefer a more generic alerting interface rather than adding feature-specific methods directly to the engine.
The method returns a pagerduty status even though PagerDuty isn't used anywhere in this implementation. Either implement PagerDuty handling or remove the unused field from the return value to avoid confusion.
Once these points are addressed, I'd be happy to take another look. Thanks again for the contribution!
Summary
Closes #512.
The existing
AlertingEnginecould already send Slack notifications for rawAgentEventandAbuseEventobjects, but there was no way for the Human-in-the-Loop layer to surface a free-form "Smart Alert" with a link back to the dashboard.Changes
agentwatch/alerting/engine.py- Addedalert_smart_alert(alert_text, dashboard_link)toAlertingEngine:SLACK_WEBHOOK_URLenv var wiring (set in.env/ Docker Compose)._post()helper (retries, signing, timeout).Usage