Agent heartbeatPro
Last activity that ticks once a second and turns amber with words after 10 s of quiet.
On this page
ProEvents arrive, then stop: after 10 s of quiet the agent reads as stale.
Installation
Usage
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
| Prop | Type | Notes |
|---|---|---|
lastActivity | number | Epoch ms of the last event |
staleAfter | number | Ms of quiet before stale. Default 10 000 |
frozen | boolean | Stops the tick for a finished run |
labels | Partial<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.