[ef-38] feat: add SessionEnd hook + fix Notification policy in example#39
Conversation
- Add `slack-on-session-end` policy for SessionEnd events - Await fetch with AbortSignal.timeout(5000) so requests complete before process.exit() - Return instruct() instead of allow() so Claude knows the notification was sent - Remove idle-only filter — notify on all notification types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Free Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughUpdated an example policy file to enhance Slack notifications by replacing fire-and-forget fetch calls with awaited requests that include 5-second timeouts and error handling. Added a new policy rule to notify Slack on Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
Summary
slack-on-session-endpolicy forSessionEndevents in the notification examplefetchwithAbortSignal.timeout(5000)so Slack requests complete beforeprocess.exit()is calledinstruct()instead ofallow()so Claude knows the notification was sentTest plan
SLACK_WEBHOOK_URLand runfailproofai p -i -c examples/policies-notification.js; let Claude go idle — confirm Slack message arrivesSLACK_WEBHOOK_URL— confirm both policies returnallow()silently🤖 Generated with Claude Code
Summary by CodeRabbit