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.

src/sweep-stale-awaiting.d.ts

37 lines · 1.1 KB · TypeScript
export type SweepStaleAwaitingInput = {
	/** Max stale awaiting records to redeliver (1–20; default 8). */
	limit?: number
	/** Preview stale records without dispatching rescue workflows. */
	dryRun?: boolean
}

export type SweepStaleAwaitingAction = {
	issueId: string
	shortId?: string | null
	projectSlug: string
	status?: string
	delivery?: unknown
	error?: string
}

export type SweepStaleAwaitingResult = {
	ok: true
	dryRun?: boolean
	swept: number
	actions: SweepStaleAwaitingAction[]
}

/**
 * Quiet-period driver: re-deliver issue records stuck awaiting a Seer RCA
 * (or Seer PR) past the grace window through the normal webhook handler.
 * Runs every 15 minutes from a scheduled job; safe to invoke manually.
 * Set `dryRun: true` to list stale records without dispatching.
 *
 * @example
 * import sweepStaleAwaiting from 'kody:@kentcdodds/sentry-triage/sweep-stale-awaiting'
 * const result = await sweepStaleAwaiting({ dryRun: true })
 * // => { ok: true, dryRun: true, swept: 2, actions: [{ issueId: '...', status: 'awaiting-seer' }] }
 */
export default function sweepStaleAwaiting(
	input?: SweepStaleAwaitingInput,
): Promise<SweepStaleAwaitingResult>