Skip to content
← Public packages

@kentcdodds/sentry-triage

Sentry triage wakes Cole (Grok Bot) per issue: one active wake per repo (lease + queue), loop-safe Discord. Cole may spawn Cursor for isolated repo work.

README.md

74 lines · 3.2 KB · Markdown

@kentcdodds/sentry-triage

Intent

Autonomous, loop-safe Sentry issue triage. A new issue in a configured project wakes Cole (Grok Bot), who decides whether to fix, filter, ignore, or write a recommendation. This package never auto-spawns Cursor cloud agents. Cole may spawn Cursor later when isolated repository work is the right tool.

Each issue keeps one Discord status message in #sentry-reports; retries edit that card in place. Sentry event text is untrusted data.

What it does

  • Receives HMAC-verified Sentry issue and Seer lifecycle webhooks, then stages durable work so retries do not duplicate wakes.
  • Prefers Seer's RCA and draft-PR context before waking Cole.
  • Keeps per-repo concurrency slots (up to 3 Cole wakes at once), the overflow queue, 10-wakes/hour cap, anomaly breaker, reconcile job, and stale-Seer sweep.
  • Persists the Discord message id before wake; a wake failure leaves a retryable queued card instead of an orphaned "Waking Cole…" message.
  • Stores active ownership as agentId: "cole", agentUrl: "grok-bot:cole" for compatibility with existing issue records and lease/outcome code.

Cole wake transport prefers the minted @kentcdodds/grok-bot wake webhook stored via ./configure-wake-webhook, then falls back to static import wake from 'kody:@kentcdodds/grok-bot/wake' (bot: 'cole'), with @kentcdodds/grok-bot listed in kody.dependencies.

Projects (Kent listing defaults)
  • kody → kentcdodds/kody
  • kody-home-connector → kentcdodds/kody-home-connector
  • epicshop → epicweb-dev/epicshop
  • kody-video → kentcdodds/kody-video
  • kcd → kentcdodds/kentcdodds.com
  • kody-exchange → kentcdodds/kody-exchange

Unconfigured projects are skipped.

Outcomes
  • fixed — root-cause fix with tests; risk-gated merge; Sentry resolved
  • filtered — narrow codebase filter plus Sentry ignore
  • ignored — genuine one-off only
  • recommendation / loop_detected / failed — analysis without a merge

Prerequisites / setup

Secrets and credentials are referenced by name only:

  • sentryWebhookSecret — inbound Sentry webhook HMAC
  • sentryAuthToken — via @kentcdodds/sentry
  • discordBotTokenKentPersonalAutomation — via @kentcdodds/discord
  • grokBotWakeWebhookUrl — user-secret fallback name for the minted Grok Bot wake URL; prefer storing the minted URL with ./configure-wake-webhook

Setup:

  1. Keep this package's live sentry webhook enabled for issue + Seer events.
  2. Mint @kentcdodds/grok-bot webhook wake, pass its URL once to ./configure-wake-webhook, and never log or paste that credential.
  3. Keep reconcile-daily and sweep-stale-awaiting enabled.
  4. Use ./probe-wake-webhook (dry-run by default) to verify the stored route.
  5. Community forks use ./adapt + ./settings before going live.

Done when

  • New actionable issues wake Cole under caps and per-repo concurrency slots (up to 3).
  • Seer RCA and PR flows wake Cole with their context.
  • record-outcome closes the issue's Discord card, frees its wake slot, and fills free slots from the queue.
  • Reconcile and stale-awaiting sweeps recover missed work without duplicates.
  • No path in this package auto-spawns Cursor.