Kanshō/Retry / failure

Retry / failure card

Communicates a failure without panic. The cause, the attempts spent, and the next actions are visible without expanding anything.

Included in the single kansho full pack. Components are not offered as separate installs.

Network failure — retryable

Static preview callbacks show the available recovery actions

Stripe API timed out

attempt 3/5

Request to stripe.invoices.list timed out after 5s. The previous two attempts also timed out.

Permission failure — needs human

Static preview: Escalate does not change demo state

Permission denied: postgres.write

attempt 1/1

The current scope grants read access to invoices but not write. A scope escalation is required to mark invoices as paid.

error: permission denied for table invoices
  at Connection.parseE (pg/lib/connection.js:614:13)
  at Connection.parseMessage (pg/lib/connection.js:464:19)

Usage

Guidance
Do
  • State the cause plainly, then offer Retry as the in-place next step.
  • Show attempt / maxAttempts so the operator knows how many tries remain.
  • Tuck the raw trace behind a disclosure — cause first, detail on demand.
Don't
  • Say 'sorry' or 'invalid' — name the problem and the next step.
  • Escalate silently — offer onEscalate when retry is exhausted.
When to use
A recoverable step failure where a retry or escalation is the next move.
When not to
A terminal outage — use the provider-outage notice with a countdown.

Accessibility

Keyboard & screen reader

Keyboard

Tab
Move focus to the trace disclosure and the Retry / Escalate buttons.
EnterSpace
Toggle the trace or activate a button.

Announces

  • The trace toggle exposes aria-expanded so its open state is announced.

Props

API reference
PropTypeDescription
titlerequiredstringWhat failed, in plain language.
causerequiredstringWhy it failed — the actionable line.
attemptnumberCurrent attempt number.
maxAttemptsnumberTotal attempts allowed.
tracestringRaw stack trace, shown behind a disclosure.
onRetry() => voidRenders the Retry action.
onEscalate() => voidRenders the Escalate action.

Included components

This page is the canonical destination for these components. All ship in the single Kansho pack.

Retry failure card

components/agent/retry-failure-card.tsx

Component documentation

Retry failure card

components/agent/retry-failure-card.tsx

Purpose

Presents a failed operation with cause, attempt count, optional trace, retry, and human escalation.

Appropriate use

Use when a recoverable agent failure needs both technical detail and a clear next action.

Example

components/agent/retry-failure-card.tsx has a representative live example in the "Network failure — retryable" section on /components/retry-failure.

States

Supports optional attempt/max count, collapsed or expanded trace, retry-only, escalation-only, both actions, or no action.

API and props

RetryFailureCard accepts title, cause, attempt, maxAttempts, trace, onRetry, onEscalate, and className.

Dependencies

Direct imports are React, Lucide icons, Button, and cn.

Accessibility

The trace trigger exposes aria-expanded and aria-controls; recovery controls are native buttons and decorative icons are hidden.

Limitations

It does not retry, escalate, redact trace content, or announce callback outcomes; the host owns those operations.

Source

Source: components/agent/retry-failure-card.tsx.

Full pack

components/agent/retry-failure-card.tsx is documented at /components/retry-failure and installs only through the single Kansho full pack; no individual component install is offered.