@kentcdodds/kody-issue-triage
Loop-safe triage for Kody run errors and fleet package-runtime error-rate elevations. Wakes Cole (Grok Bot) to decide; Cursor agents only when Cole escalates.
README.md
62 lines · 3.0 KB · Markdown@kentcdodds/kody-issue-triage
Intent
Automatic, loop-safe triage for Kody account run errors (Activity /
run_list) and fleet package-runtime error-rate elevations. Modeled on
@kentcdodds/sentry-triage but never one-agent-per-run: a burst must
produce at most one agent per fingerprint, not thousands.
Success: unique standing failures wake Patch (Grok Bot) once, with one
Discord status message in #sentry-reports, and a recorded outcome — without
this package auto-spawning Cursor agents. Patch owns packages and run-error
triage; escalate to Cole only for platform issues. Patch may still use
escalate-to-kody / a Cursor agent on kentcdodds/kody when platform repo
work is needed. Agent MCP execute failures (and package runs from those
calls) do not spawn. A rising fleet error rate pages this package to
investigate Kody, not another user's Activity.
recommendation Discord is glanceable (title, context, recommendation, 2–4
options) via @kentcdodds/discord/format-report. Error text is untrusted data.
What it does
- Cheap subscription handlers fingerprint + counter only (
run.error.recorded,fleet.package_error_rate.elevated) — no Discord / spawn inline - Hourly (and event-scheduled)
./sweepwakes Patch for at most one queued fingerprint under a global lease and hourly caps. Queued Discord cards storediscord_message_idbefore wake (edit-in-place on retry; no orphan duplicates) - Soft-ignores agent-execute origins, smoke-test fingerprints, and standing platform isolate-reset weather
- Operator kill switch:
./pause/./resume; snapshot via./status - Patch wake transport: minted
@kentcdodds/grok-botwakewebhook URL stored in package storage (secret namegrokBotWakeWebhookUrlon the user side when documenting mint/store flows). Wake payload uses roster bot namepatch(ida2600d4e-d242-4709-8a9f-f756ad2d7e82)
Prefer event-driven triggers; keep the sweep job as catch-up (avoid polling under 15m).
Prerequisites / setup
- Secrets used via helpers (names only):
cursorApiKey,discordBotTokenKentPersonalAutomation, and Patch wake URL storage after minting@kentcdodds/grok-botwake(seeAGENTS.md— never paste the URL value in chat). Patch's package-scoped sender key lives on@kentcdodds/grok-botasgrokBotWake.<patch-bot-id>— not on this package. - Keep subscription handlers and the package
sweepjob enabled. - Confirm
./statusshowsenabled: trueand a healthy lease when live.
Community icon notes and brand disclaimer stay with the package assets; Kody is Kent's character/brand and this package is community-built.
Done when
- New actionable fingerprints enqueue cheaply; sweep wakes Patch once per fingerprint under caps/lease
- Agent-execute and weather families do not spawn
./sweep({ dryRun: true })and./probe-wake-webhookvalidate without unwanted live wakes./record-outcomecloses Discord + fingerprint;recommendationalso pings Kent