Skip to content
GitHub (opens in a new tab)

AgentCheckpoints

A run timeline of checkpoints: rewind to one and start a new attempt; the replaced attempt stays faded under it.

stableOrganismcontracts/agentcheckpoints.json

Preview

AgentCheckpoints

A run timeline where every finished step is a checkpoint you can rewind to. Not AgentTrail.

Master

The run reads, pulls totals, then fails to draft the summary. Hover Pull invoice totals, choose Rewind here and confirm: a second attempt starts from there and the first stays faded under it. Use the pager to switch attempts.

Weekly invoice digest

example

No checkpoints yet

Usage

Keep every attempt in start order. Each attempt lists only its own steps; branchFrom names the step it started from. In onRewind, mark the steps that were cut short stopped and add the new attempt. A new attempt comes to the front by itself; the pager reaches the older ones.

Do's

  • a person can send an agent run back to an earlier step and try again from there
  • comparing a new attempt with the one it replaced, on one rail
  • a run log where finished steps are restore points

Don'ts

  • a run log with no rewind — AgentTrail
  • what the agent intends to do before it runs — AgentPlan
  • undoing finished actions one by one — ActivityFeed variant agent
  • many agents at once — AgentMonitor or RunLanes
<AgentCheckpoints
  title="Weekly invoice digest"
  attempts={[
    { id: "a1", steps: [read, pull, draft, send] },
    { id: "a2", branchFrom: "pull", steps: [rewrite, send2] },
  ]}
  onRewind={(stepId) => startAttemptFrom(stepId)}
/>

When to use

  • a person can send an agent run back to an earlier step and try again from there
  • comparing a new attempt with the one it replaced, on one rail
  • a run log where finished steps are restore points

When not to use

  • a run log with no rewind — AgentTrail
  • what the agent intends to do before it runs — AgentPlan
  • undoing finished actions one by one — ActivityFeed variant agent
  • many agents at once — AgentMonitor or RunLanes

What an agent reads

import { AgentCheckpoints } from "agentic-ds-kit";
must
  • section aria-labelledby the h3 title
  • the rail is an ordered list; the running step (else the failed one) has aria-current=step
  • each step names its status for screen readers; marks are aria-hidden
  • Rewind here is a real button named with its step ("Rewind here Pull invoice totals"), with aria-expanded and aria-controls on the confirm
  • the confirm takes focus when it opens, Tab and Shift+Tab stay inside it, and Escape or Cancel close it and return focus to its Rewind button
  • the replaced attempt stays in the reading order as a nested list named "Attempt 1, replaced"
  • with more than one attempt the header shows kit Pagination (compact) named "Attempts"; it shows and announces "Attempt 2 of 2"
  • one attempt shows a "3/4" counter read as "Step 3 of 4"
  • motion: only live changes move, and a first load and prefers-reduced-motion render at rest. The branch mark draws in (motion.duration.300, ease-out) when a new attempt starts, the replaced attempt settles to faded (motion.duration.200), the confirm fades in (motion.duration.150), a new row eases in (motion.duration.200), switching attempts crossfades with no slide (motion.duration.200), and the running mark is the shared spinner
defaults
Nothing extra in the contract.
stops if
  • Do not invent a local checkpoint list, branch view or attempt tabs; this is the piece
  • Do not add Rewind to AgentTrail; it stays a read-only run log
  • Do not draw more than the one replaced attempt; older attempts are reached with the pager
  • Do not colour failed steps with a fill; danger goes on the mark and text only
  • Do not use raw hex

From contracts/agentcheckpoints.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
titlestringYes—The task, e.g. "Weekly invoice digest". The h3 that names the section.
attemptsarrayYes—{ id, branchFrom?, steps: { id, label, status: "done" | "running" | "failed" | "stopped" | "pending", duration?, timer?, sublabel? }[] }[] in start order. Each attempt lists only its own steps; branchFrom is the id of the step in an earlier attempt it started from, and the rail shows that attempt's steps up to it first. duration for finished steps, timer for the running one, sublabel for the tool call in mono. Empty shows "No checkpoints yet".
iconKitIconNo—Lucide icon before the title.
tagstringNo—Small neutral mono tag after the title.
attemptnumberNo—Controlled 0-based index of the attempt in front.
defaultAttemptnumberNo—Uncontrolled first attempt in front. Default: the newest. A new attempt always comes to the front.
onAttemptChangefunctionNo—(index) => void when the pager switches attempts.
onRewindfunctionNo—(stepId) => void after the person confirms. Add an attempt with branchFrom = stepId and mark the cut-short steps stopped. Left out, no Rewind shows. Rewind shows on done and failed steps of the attempt in front: on hover or focus in place of the time, always on touch screens. It opens an inline confirm under the row (Rewind, the one solid primary, and Cancel).
  • Component
    →

    AgentTrail

    A vertical step list for a running agent task: done steps with durations, the current step with a live timer, then pending steps.

  • Component
    →

    AgentPlan

    What an agent intends to do, before or during a run.

  • Block
    →

    Activity feed

    What people and agents did across the workspace, newest first and grouped by day.

  • Component
    →

    AgentMonitor

    One agent at work: a live clock and running cost lead; finished steps sit in a time strip you can open.