Dashboard Agent: Watch (background condition watches + wake notifications + alerts) - #4456
Dashboard Agent: Watch (background condition watches + wake notifications + alerts)#4456kathiekiwi wants to merge 7 commits into
Conversation
Revert of the extraction commit (19d6625): restores schedule_watch, the tick loop, wake delivery with fenced claims, the expiry sweep, watch alerts, the watches table and migrations, and all UI surfaces.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
- contracts: three resolutions (condition_met / window_completed /
condition_impossible) + per-kind observed outcomes, and the exhaustive
resolved-result mapping (category, tone, semantic icon, headline key) —
a new kind fails to compile until every cell is filled; icons follow the
outcome, a failed run never wears a success check
- wire encoding stays fired|expired; resolution + observation travel in facts
- the row freezes resolution + observed outcome + facts in one UPDATE at the
terminal transition; delivery never re-reads the source (migration 0007)
- run_finished preserves the final status; new queue_depth_above kind (same
depth seam, inverted, threshold in the identity); the window boundary gets
one final evaluation — only pending/unavailable becomes window_completed
- the immediate check no longer creates a row: satisfied/terminal_unsatisfied
return a one-shot outcome; the inline-resolution and narration-proof
machinery is deleted
- watch-presentation.ts: fact-first headlines ('Run abc123 failed', 'email-sends
queue drained') with the Watch update micro-label; GOOD_NEWS_KINDS is gone
from banner and email; the wake narration speaks resolution language
…bscribe (TRI-12820) - the plan half of the alert gate is removed (billing re-attaches later); denial is feature flag or missing email transport only - an alert can only go to the user's own account email; anything else is 400 - unsubscribe is a compare-and-swap (409 on conflict); the summary toast id is stable; watch tests no longer import env.server; per-tick re-authorization reads the primary, not the replica
The card: - one universal Watch… entry on run, queue, error and health surfaces; the panel opens with the card pre-filled with the object's recommended condition - an ephemeral form/system block: Start watching accepts the recommendation in one tap; Customize expands condition variant, threshold, window, cadence (schema-floored) and two independent follow-ups — in-chat delivery is fixed and inexpressible to disable - a created watch persists as the confirmation block (four lifetime facts); an immediate-check answer persists as the one-shot result block, no chip, no wake; an abandoned card leaves no trace - every watch intent (report cards, investigation recurrence) opens the card pre-filled instead of posting a text request - new run_failed kind (failing is the condition; succeeding makes it impossible); toast titles and terminal chips render the resolved result — a failed run never wears a success check; nine-state storybook group Investigate on attention: - a watch may carry investigateOnAttention, set only on an explicit ask; on an attention outcome the wake states the investigation has started and opens it in the same turn — never on positive/neutral, never without consent, never delaying or invalidating the wake itself - the watch row carries the external project ref so a wake-opened investigation persists under the scope later turns can continue (migration 0008) - watch-for-recurrence is offered only on concluded cards citing an error fingerprint, emitting a watch intent that pre-fills the card
b7fe804 to
8601540
Compare
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
… feat/dashboard-agent-watch
… feat/dashboard-agent-watch
Stacked on #4418 — the diff against that branch is the complete Watch feature, extracted so the base agent PR can land without it.
What's in here
watchestable + delivery/claim columns (drizzle migrations),DASHBOARD_AGENT_WATCHalert type (prisma).Review history
Five external review rounds are already folded in (env binding from the token scope, atomic 3-watch cap, tick idempotency, sweeper reauthorization, fenced delivery claims, honest check semantics — stale data never reads as an answer).
Verification
🤖 Generated with Claude Code