Skip to content
← Public packages

@kentcdodds/kody-issue-triagePublic

Loop-safe Cursor triage for Kody account run errors: fingerprint, cap, lease, one Discord message.

Browse files

License
MIT
Published
August 21, 2026
Pinned commit
db110be
Rating
No ratings yet
Forks
1
Adaptation effort

README

@kentcdodds/kody-issue-triage

Intent

Automatic, loop-safe triage for Kody account run errors (the Activity / run_list issues), modeled on @kentcdodds/sentry-triage but never one-agent-per-run. A burst like the 2026-08-16 skills repo.pushed storm must produce at most one agent for that fingerprint, not thousands.

Success: unique standing failures get one Cursor cloud agent, one Discord status message in #sentry-reports, and a recorded outcome — without this package being able to fan out into a runaway of agents or more errors.

Guardrails (no runaway)

  • run.error.recorded handler only writes packageStorage(). It does not spawn agents, post Discord, call run_get, or start workflows.
  • Only the 15m sweep job may spawn. ./pause / ./resume are the operator kill switch; the job is enabled after a dry-run smoke test.
  • One agent per fingerprint (surface + owner + normalized error family), not per run id. TypeError reading X and Execution timed out after Ns collapse to coarse families so sonos_list_groups vs sonos_list_players does not spawn two agents. JSON wrappers such as Shade workflow event failed: {"key":…} drop instance keys (and truncated subscription payloads that never include the inner TypeError) so each shade scene does not spawn its own agent. A same-owner sibling already fixed / recommendation / resolved_noise / ignored for an overlapping coarse or wrapper family is auto-closed without spawning.
  • Skip this package, subscription surface (platform already suppresses those events), ad-hoc execute failures with no package owner, smoke-test fingerprints, and ./record-outcome validation throws from sibling triage packages.
  • After a fingerprint is fixed or recommendation with a kody_agent_id, later leftover events increment the count but do not re-queue a new agent. Leftover runs that started before completed_at also stay closed.
  • A same-owner sibling that already finished fixed / recommendation for the same coarse family is auto-closed as resolved_noise (no spawn).
  • Agents that die without record-outcome are marked failed after the 2h stale-spawn window so they cannot hold the queue forever.
  • Max 3 agents per clock hour. More than 15 new fingerprints or 80 raw events in an hour trips the anomaly breaker (Discord alert, no more spawns that hour).
  • Global lease: at most one in-flight agent. Further fingerprints wait.
  • Kill switch in packageStorage() (config.enabled). ./pause / ./resume.
  • Agents must not treat this package's own PRs/publishes as new issues.
  • Before spawn, sweep lists matching Cloud agents, related open PRs, and owner-package activity. A LIVE sibling for the same family stays queued instead of starting a second agent. The spawn prompt includes the loop guard (get-issue-state + matching open runs) and that peer snapshot so the agent does not spend its first turn repeating those calls. Names and titles stay untrusted.

Flow

  1. A failed job / workflow / package export emits run.error.recorded.
  2. ./on-run-error fingerprints and upserts a row (milliseconds).
  3. sweep (15m, or invoke ./sweep) claims the oldest queued fingerprint, gathers peer agents / related PRs / owner-package activity, posts Discord, and spawns one grok-4.6 agent on kentcdodds/use-kody.
  4. That agent classifies package vs Kody vs noise. Package fixes use clone-edit-publish. Kody issues call ./escalate-to-kody, which spawns one grok-4.6 agent on kentcdodds/kody to fix if obvious or recommend (Discord to Kent) if not.
  5. ./record-outcome edits the Discord status message. A recommendation also posts a new Discord message so Kent is notified.

Community icon

community-icon.png is the official Kody Community Project mark from docs/use/assets/kody-community-project-mark.png in the kody repository, with a bug on Kody's head and Kody looking irritated at it. The canvas outside the badge is transparent.

Kody is a character and brand belonging to Kent C. Dodds. This package is community-built and is not affiliated with or endorsed by the official Kody project.

Exports

  • . — package overview
  • ./on-run-error — subscription handler
  • ./sweep — spawn path (dryRun supported)
  • ./get-issue-state — loop guard for agents (includes a fresh peer snapshot)
  • ./peer-context — refresh matching agents, related PRs, and owner activity
  • ./escalate-to-kody — spawn one Kody-repo agent for platform issues
  • ./record-outcome — final report
  • ./pause / ./resume / ./status — operator controls
Report this listing

Log in to report this listing.