feat(#1466 P2): automation-gate nudge + "I've got this" toggle + calendar fix#1470
Conversation
…ndar fix Escalation/nudge + toggle slice of the Automation Gate epic (internal-only — advisor bell/email, no client sends). Builds on P1's `proposed` status + gate. - Courtesy nudge: hourly `recurring.automation_gate_nudge` (sibling of task_due_reminder) sweeps automation_job_history for proposed/paused rows firing within 24h, groups by trip, resolves the advisor (trip owner), and sends a new internal `automation_gate` notification with an advisor-scoped day-bucketed dedupeKey (one nudge/trip/day via the global dedupe claim). Also breaks the "paused-forever silence" — a parked row nearing its time gets the same nudge. Pure query/grouping + key logic in automation-gate-nudge.ts. - "I've got this" toggle: UI sugar over existing pause/resume — Pause now renders on proposed (autopilot) cards too and relabels to "I've got this"; Resume relabels to "Back to autopilot". Zero new backend. - Calendar fix (P1 handoff): scheduled-email query widened from status='queued' to include 'proposed' so gate jobs surface on the calendar before review. New notification category `automation_gate` (platform + email default), registered across notification.types, shared-types, and the preferences schema/UI. No migration (dedupe index = "already nudged"). Tests: pure query/grouping + dedupeKey-embeds-advisorId spec; processor integration proving a 2nd sweep same UTC day does not re-notify. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
Next review available in: 6 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: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (13)
✨ 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 |
Automation Gate epic #1466 — slice P2 (escalation/nudge + toggle)
refs #1466. Builds on merged P0 (reliability) + P1 (
proposedstatus + gate). INTERNAL-ONLY — advisor bell/email notifications, no client sends. Autopilot-default; ships LIVE on merge. Additive/no-backfill, no migration (the notification dedupe index is the "already nudged" state).What ships
recurring.automation_gate_nudge(sibling ofrecurring.task_due_reminderon the CLIENT_CARE queue). Each sweep:automation_job_historyforstatus IN ('proposed','paused')withscheduled_forin(now, now+24h],trip_id, resolves the advisor as the trip owner (automation rows carry nocreated_by),automation_gatenotification per trip withactionUrl:/trips/{id}?tab=automationsand an advisor-scoped, UTC-day-bucketeddedupeKey(automation-gate:{advisorId}:{tripId}:{bucket}).dedupe_key, so the advisor id is embedded → exactly one nudge/trip/day, no cross-advisor collision. Per-triptry/catchkeeps the sweep best-effort.automation-gate-nudge.ts(unit-tested, DB-free).proposed(autopilot) cards and reads "I've got this"; Resume reads "Back to autopilot".isControllable+ the backend pause path already acceptproposed(P1).status='queued'to include'proposed', so gate jobs (which are BullMQ-live) appear on the calendar before review instead of being invisible.New notification category
automation_gate(default channels[platform, email]) wired acrossnotification.types.ts,notification.service.ts,@tailfire/shared-types, the preferences schema, and the profile settings UI.Tests
automation-gate-nudge.spec.ts— pure query/grouping (window bounds, gate-status filter, grouping, deterministic ordering) +dedupeKey-embeds-advisorId + copy.client-care.processor.automation-gate-nudge.spec.ts— integration: sends internalautomation_gatenudge to the trip owner; 2nd sweep same UTC day does NOT re-notify (dedupe holds); skips owner-less trips.automation-grouping(20) + admin typecheck clean.Review
156fe45d— verified dedupe correctness, no client-send path, best-effort handling, and that the toggle/calendar changes don't regress queued behavior. Two non-blocking nits from the first pass (UI default parity + a stale comment) were addressed and re-approved.🤖 Generated with Claude Code