Skip to content
Sign in
AgentsAgent heartbeatMenu

Agent heartbeatPro

Last activity that ticks once a second and turns amber with words after 10 s of quiet.

ProEvents arrive, then stop: after 10 s of quiet the agent reads as stale.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/agent-heartbeat

Usage

tsx
import { AgentHeartbeat } from "@/components/ui/chatcn/pro/agent-heartbeat"

<AgentHeartbeat lastActivity={run.lastEventAt} />

Pass the time of the agent's last event: a token, a tool call or a log line. A slow agent keeps ticking up from a few seconds; a stuck one passes staleAfter and says so. Freeze it when the run ends.

Examples

States

ProNo activity, fresh, stale, a longer threshold and frozen.

Props

PropTypeNotes
lastActivitynumberEpoch ms of the last event
staleAfternumberMs of quiet before stale. Default 10 000
frozenbooleanStops the tick for a finished run
labelsPartial<AgentHeartbeatLabels>Every string

Accessibility

  • The ticking time is never announced; going stale is, once, in a polite live region.
  • Stale adds a word and an hourglass, not only the amber.