Agent timeline
Display an orchestrated multi-agent run on a shared time axis with handoff connectors, replay controls, live tracking, and span details.
import { AgentTimeline } from '@uthereal/ui/agent-timeline'Agent timeline playground
Checkout conversion drop on Oct 14
Finished: 5 agents 26.4s 1.5x faster than sequential $0.16
Finished: 5 agents, 26.4s, 1.5x faster than sequential, $0.16
Overview
AgentTimeline visualizes one orchestrated multi-agent run across parallel lanes on a shared elapsed-time axis. The first agent is the orchestrator; each subagent row plots thinking, tool, and waiting spans with SVG elbow handoff connectors and port dots between lanes. A playhead replays the run smoothly while header counters track elapsed time, tokens, and cost before settling into a run summary (N agents · Xs · Yx faster than sequential · $Z).
Use AgentTimeline to inspect parallel agent execution, handoff paths, failures, and retries in run histories, trace viewers, or live status panels. For hierarchical nested spans with redacted payloads, use Trace waterfall. For an editable step-by-step plan before execution, use Plan.
Usage
'use client'
import { AgentTimeline } from '@uthereal/ui/agent-timeline'
export function WeeklyChurnRun() {
return (
<AgentTimeline
runId="weekly-churn-42"
title="Weekly churn report"
agents={[
{
id: 'lead',
name: 'Orchestrator',
model: 'Claude Opus 5.5',
price: 8,
},
{ id: 'sql', name: 'Analyst', model: 'Claude Haiku 5.5', price: 0.2 },
]}
spans={[
{
id: 'plan',
agentId: 'lead',
kind: 'thinking',
startMs: 0,
endMs: 1400,
label: 'Planned the report',
tokens: 1200,
},
{
id: 'wait',
agentId: 'lead',
kind: 'waiting',
startMs: 1400,
endMs: 6200,
label: 'Waiting on the analyst',
},
{
id: 'query',
agentId: 'sql',
kind: 'tool',
tool: 'PostgreSQL',
startMs: 1700,
endMs: 4100,
label: 'Pulled churn by plan',
tokens: 2400,
},
{
id: 'summary',
agentId: 'sql',
kind: 'thinking',
startMs: 4100,
endMs: 5900,
label: 'Summarized the numbers',
tokens: 900,
},
]}
handoffs={[
{
id: 'dispatch',
from: 'lead',
to: 'sql',
atMs: 1400,
label: 'Churn by plan, last 8 weeks',
},
{
id: 'return',
from: 'sql',
to: 'lead',
atMs: 6200,
label: 'Churn rose on the Team plan',
},
]}
onSpanSelect={(span) => console.log(span?.id ?? null)}
/>
)
}A finished run renders complete and ready to replay unless autoPlay is true. Set live to true with startedAt (epoch milliseconds) and omit endMs on open spans to follow an in-progress run; turn live off and supply final timestamps when the run ends. Change runId when switching to a different run so local replay state resets.
Examples
Live run
Set live to true and omit endMs on open spans. Playback controls hide while the display clock grows open spans and steps the time axis calmly as work streams in.
Release readiness check
Live 0.0s 0 tokens $0.00, 1 agent working
Failure recovery and pinned path
Retain failed tool calls (status="failed") alongside their retry span (retry={true}). Set defaultSelectedId to pin a span and highlight its handoff path while dimming unrelated lanes.
Invoice reconciliation
Finished: 3 agents 8.1s 1.2x faster than sequential $0.02
Finished: 3 agents, 8.1s, 1.2x faster than sequential, $0.02
Span kinds
Each span combines shape, fill, and iconography so status never depends on color alone.
| Span setting | Visual treatment |
|---|---|
kind="thinking" | Soft tint of the lane color; counts toward active work and speedup. |
kind="tool" | Solid lane color; shows tool mark and name in the span card (GitHub, Web search, PostgreSQL, Notion). |
kind="waiting" | Diagonal hatch with subtle border; excluded from speedup and active-work shine. |
| Active span | Square leading edge with solid frontier bar and working shimmer; corners round off on completion. |
status="failed" | Danger tint, inset danger ring, cross icon once finished, and a Failed badge with detail in the card. |
retry={true} | Retry icon inside completed spans and beside detail in the span card. |
Supply costUsd per span or price (blended USD per million tokens) on each agent. Waiting spans do not contribute to the sequential speedup ratio, and the speedup segment hides when the ratio is below 1.1x.
API reference
These serializable arguments and defaults come directly from the component schema.
| Argument | Type / default | Description |
|---|---|---|
labels | AgentTimelineLabels— | Translated transport, grouping, control and feedback text; unspecified labels retain defaults. |
runId | stringDefault: "run" | Stable run identity. Change it to reset replay when replacing the run. |
title | stringDefault: "Agent run" | Visible heading and accessible name of this inspector. |
agents | Agent[]Default: [{"id":"lead","name":"Orchestrator","model":"Claude Opus 5.5","provider":"anthropic","role":"Plans the run, delegates and merges results","price":8},{"id":"checker","name":"Checker","model":"GPT-6 Luna","provider":"openai","role":"Rules out causes outside the codebase","price":0.8},{"id":"researcher","name":"Researcher","model":"Claude Sonnet 5.5","provider":"anthropic","role":"Finds recent changes to checkout","price":4},{"id":"analyst","name":"Analyst","model":"Claude Haiku 5.5","provider":"anthropic","role":"Measures the drop in the orders database","price":0.2},{"id":"writer","name":"Writer","model":"Gemini 3.8 Flash","provider":"google","role":"Drafts the incident summary","price":0.85}] | Agents in stable display order; the first lane is the orchestrator. IDs must be unique. |
spans | Span[]Default: [{"id":"sample-0","agentId":"lead","kind":"thinking","startMs":0,"endMs":2000,"label":"Split the investigation into three tracks","status":"ok","retry":false,"tokens":1920},{"id":"sample-1","agentId":"lead","kind":"waiting","startMs":2000,"endMs":14600,"label":"Waiting on the analyst, researcher and checker","status":"ok","retry":false},{"id":"sample-2","agentId":"lead","kind":"thinking","startMs":14600,"endMs":16800,"label":"Merged findings: PR #4812 broke address autofill in Safari","status":"ok","retry":false,"tokens":4380},{"id":"sample-3","agentId":"lead","kind":"waiting","startMs":16800,"endMs":23000,"label":"Waiting on the writer","status":"ok","retry":false},{"id":"sample-4","agentId":"lead","kind":"thinking","startMs":23000,"endMs":25200,"label":"Reviewed the draft and tightened the timeline","status":"ok","retry":false,"tokens":3140},{"id":"sample-5","agentId":"lead","kind":"tool","startMs":25200,"endMs":26400,"label":"Published the summary to the incidents page","status":"ok","retry":false,"tool":"Notion","tokens":260},{"id":"sample-6","agentId":"checker","kind":"thinking","startMs":3500,"endMs":4100,"label":"Listed outside causes to rule out","status":"ok","retry":false,"tokens":480},{"id":"sample-7","agentId":"checker","kind":"tool","startMs":4100,"endMs":5600,"label":"Searched for payment provider incidents on Oct 14","status":"ok","retry":false,"tool":"Web search","detail":"No matching incidents","tokens":3920},{"id":"sample-8","agentId":"checker","kind":"thinking","startMs":5600,"endMs":6300,"label":"Checked browser releases next","status":"ok","retry":false,"tokens":610},{"id":"sample-9","agentId":"checker","kind":"tool","startMs":6300,"endMs":7700,"label":"Searched browser release notes for autofill changes","status":"ok","retry":false,"tool":"Web search","tokens":4460},{"id":"sample-10","agentId":"checker","kind":"thinking","startMs":7700,"endMs":9100,"label":"Ruled out causes outside the codebase","status":"ok","retry":false,"tokens":1180},{"id":"sample-11","agentId":"researcher","kind":"thinking","startMs":2900,"endMs":3500,"label":"Planned the code search","status":"ok","retry":false,"tokens":620},{"id":"sample-12","agentId":"researcher","kind":"tool","startMs":3500,"endMs":4800,"label":"Listed 14 merged PRs touching checkout since Oct 10","status":"ok","retry":false,"tool":"GitHub","tokens":2140},{"id":"sample-13","agentId":"researcher","kind":"thinking","startMs":4800,"endMs":5500,"label":"Narrowed to 3 PRs shipped Oct 13 and 14","status":"ok","retry":false,"tokens":980},{"id":"sample-14","agentId":"researcher","kind":"tool","startMs":5500,"endMs":7500,"label":"Read the diff of PR #4812, an address autofill refactor","status":"ok","retry":false,"tool":"GitHub","tokens":6850},{"id":"sample-15","agentId":"researcher","kind":"thinking","startMs":7500,"endMs":8500,"label":"Traced the change to the Safari autofill path","status":"ok","retry":false,"tokens":1410},{"id":"sample-16","agentId":"researcher","kind":"tool","startMs":8500,"endMs":9700,"label":"Checked deploys: #4812 shipped Oct 13 at 21:40","status":"ok","retry":false,"tool":"GitHub","tokens":1760},{"id":"sample-17","agentId":"researcher","kind":"thinking","startMs":9700,"endMs":11900,"label":"Wrote up the suspect change with evidence","status":"ok","retry":false,"tokens":2230},{"id":"sample-18","agentId":"analyst","kind":"thinking","startMs":2300,"endMs":3000,"label":"Wrote a conversion query for Oct 7 to 15","status":"ok","retry":false,"tokens":540},{"id":"sample-19","agentId":"analyst","kind":"tool","startMs":3000,"endMs":5100,"label":"Conversion query timed out","status":"failed","retry":false,"tool":"PostgreSQL","detail":"Hit the 2s statement timeout on a full scan of orders","tokens":410},{"id":"sample-20","agentId":"analyst","kind":"thinking","startMs":5100,"endMs":5700,"label":"Rewrote the query to use the date index","status":"ok","retry":false,"tokens":380},{"id":"sample-21","agentId":"analyst","kind":"tool","startMs":5700,"endMs":7300,"label":"Retried: conversion by day and platform","status":"ok","retry":true,"tool":"PostgreSQL","detail":"Succeeded on the second attempt","tokens":1960},{"id":"sample-22","agentId":"analyst","kind":"thinking","startMs":7300,"endMs":8300,"label":"Found the drop is Safari only, down 9.2%","status":"ok","retry":false,"tokens":720},{"id":"sample-23","agentId":"analyst","kind":"tool","startMs":8300,"endMs":9900,"label":"Pulled checkout errors by step for Safari","status":"ok","retry":false,"tool":"PostgreSQL","tokens":2310},{"id":"sample-24","agentId":"analyst","kind":"thinking","startMs":9900,"endMs":11800,"label":"Traced the failures to the address step","status":"ok","retry":false,"tokens":860},{"id":"sample-25","agentId":"analyst","kind":"tool","startMs":11800,"endMs":13000,"label":"Counted affected orders: 1,284","status":"ok","retry":false,"tool":"PostgreSQL","tokens":1140},{"id":"sample-26","agentId":"analyst","kind":"thinking","startMs":13000,"endMs":14300,"label":"Summarized the numbers","status":"ok","retry":false,"tokens":640},{"id":"sample-27","agentId":"writer","kind":"thinking","startMs":17100,"endMs":17900,"label":"Read the merged findings","status":"ok","retry":false,"tokens":1850},{"id":"sample-28","agentId":"writer","kind":"tool","startMs":17900,"endMs":18800,"label":"Pulled the PR #4812 description for context","status":"ok","retry":false,"tool":"GitHub","tokens":1120},{"id":"sample-29","agentId":"writer","kind":"thinking","startMs":18800,"endMs":22700,"label":"Drafted the incident summary, 412 words","status":"ok","retry":false,"tokens":2940}] | Bounded authoritative span snapshots with stable IDs and valid references; arrays replace. |
handoffs | Handoff[]Default: [{"id":"handoff-0","from":"lead","to":"analyst","atMs":2000,"label":"Measure the drop by day and platform"},{"id":"handoff-1","from":"lead","to":"researcher","atMs":2600,"label":"Find recent changes to checkout"},{"id":"handoff-2","from":"lead","to":"checker","atMs":3200,"label":"Rule out outside causes"},{"id":"handoff-3","from":"checker","to":"lead","atMs":9400,"label":"No outside incident on Oct 14"},{"id":"handoff-4","from":"researcher","to":"lead","atMs":12200,"label":"PR #4812 is the likely cause"},{"id":"handoff-5","from":"analyst","to":"lead","atMs":14600,"label":"Safari only, 1,284 orders affected"},{"id":"handoff-6","from":"lead","to":"writer","atMs":16800,"label":"Draft the incident summary"},{"id":"handoff-7","from":"writer","to":"lead","atMs":23000,"label":"Draft ready for review"}] | Work dispatches and results between distinct known agents; arrays replace. |
live | booleanDefault: false | Follow open host spans with a display clock; never starts or fetches work. |
startedAt | integer— | Run start as epoch milliseconds, used only by the live display clock. |
durationMs | integer— | Authoritative duration in milliseconds. |
autoPlay | booleanDefault: false | Replay when the inspector enters view; reduced motion starts finished until explicitly played. |
speeds | number[]Default: [1,2] | Allowed replay speed multipliers; the selector hides when only one remains. |
defaultSpeed | numberDefault: 1 | Initial replay multiplier; must be one of speeds. |
currency | stringDefault: "USD" | ISO 4217 currency for cost formatting. |
locale | string— | BCP 47 locale for number and currency formatting; inherited from the application when omitted. |
defaultSelectedId | string— | Initially selected item ID; existing host selection wins over edits. |
selectAction | string— | Action fired when a span is pinned through the transport; carries the pinned span ID. |
recipe | studio | softDefault: "studio" | Visual treatment. Both recipes preserve interaction behavior. |
theme | AgentTimelineTheme— | Color mode, accent and typed semantic token overrides. |
motion | none | subtle | expressiveDefault: "subtle" | Animation preset. System reduced-motion preferences take precedence. |
motionOptions | DisclosureMotionOptions— | Disclosure transition overrides; durations are milliseconds. |
dir | ltr | rtl— | Reading direction; inherited from the page when omitted. |
Each Agent accepts { id, name, model?, provider?, role?, color?, price? }. Each Span accepts { id, agentId, kind, startMs, endMs?, label, detail?, tool?, tokens?, costUsd?, status?, retry? }. Each Handoff accepts { id, from, to, atMs, label? }.
React integration
| Prop | Purpose |
|---|---|
selectedId / selectedSpanId | Controlled pinned span ID, or null when nothing is pinned. |
onSelectedIdChange(id) | Called when a span is pinned or unpinned, in both controlled and uncontrolled modes. |
onSpanSelect(span) | Called with the full pinned span snapshot, or null when unpinned. |
onAction(action, spanId) | Fires selectAction with the pinned span ID when a span is pinned. |
timeMs / onTimeChange(ms) | Controlled playhead position in milliseconds. |
playing / onPlayingChange(on) | Controlled replay playing state. |
onComplete() | Called once each time a replay reaches the end or a live run settles. |
nowMs | Optional epoch-millisecond clock override for deterministic live snapshots. |
renderAgentMark(context) | Custom 12px decorative provider glyph for lane headers and span cards. |
renderToolMark(context) | Custom 12px decorative tool glyph for span card metadata. |
preset / tokens | Application defaults and --ui-* CSS variable overrides applied after the typed theme. |
ref, className, style, ... | Forwarded directly to the root <section> element. |
Playback & keyboard
| Target & key | Action |
|---|---|
Tab | Moves through spans (single roving tab stop), the axis scrubber, Play/Pause, Restart, and Speed. |
Span ArrowLeft / ArrowRight | Moves to the previous or next visible span in the same lane (respects RTL). |
Span ArrowUp / ArrowDown | Moves to the nearest visible span by midpoint in the lane above or below. |
Span Home / End | Jumps to the first or last visible span in the current lane. |
Span Enter / Space | Pins the focused span (aria-pressed="true") and dims unconnected paths; press again to unpin. |
Escape | Unpins the pinned span from anywhere inside the timeline. |
Scrubber ArrowLeft / ArrowRight | Steps playhead by 0.5s (5s with Shift, respects RTL). |
Scrubber PageUp / PageDown | Steps playhead by 5s. |
Scrubber Home / End | Jumps playhead to 0s or the end of the run. |
Each span button carries a full accessible name (agent, kind, tool, status, label, time range, tokens, detail), so the floating hover/focus card is marked aria-hidden="true". A polite role="status" region announces replay, pause, live state, and the finished summary without flooding screen readers during counting.
Motion & theming
During replay and live tracking, requestAnimationFrame writes --ui-agent-time directly on the plot with zero React re-renders per frame while throttling header counter updates to 20 Hz. Handoff connectors draw in over 360 ms with port dots popping in, and the floating span card glides between spans on visualSpring.morph while flipping below when near the top edge.
- Reduced motion (
prefers-reduced-motion: reduce): StartsautoPlayruns finished until explicitly played, removes shine, shimmer, connector draw, and card glide, and keeps 120 ms opacity crossfades. - Immediate motion (
motion="none"): Disables all transitions and animations immediately (0ms). - Responsive container: Below
520px, the sticky label column narrows and moves model names into the span card. Below300px, the label column collapses to lane dots while the plot scrolls horizontally and follows the playhead.
| Token | Role |
|---|---|
--ui-surface, --ui-surface-raised | Timeline panel background and floating span card surface. |
--ui-border, --ui-border-subtle | Panel/card border, axis divider, and vertical tick gridlines. |
--ui-text, --ui-text-secondary, --ui-muted | Titles, orchestrator lane color, and axis tick labels. |
--ui-series-1 .. --ui-series-8 | Default palette for subagent lanes, spans, and handoff connectors. |
--ui-success, --ui-danger | Finished check icon and failed tool call state. |
--ui-agent-timeline-row-height | Height of each agent lane (44px default). |
--ui-agent-timeline-label-width | Sticky agent label column width (176px default). |
--ui-agent-timeline-compact-label-width | Sticky agent label column width below 520px (132px default). |
Composition
In an agent composition, AgentTimeline is a leaf. The host persists /components/instance-<id>/selectedId (seeded from defaultSelectedId) and handles selectAction through onAction. Config edits never start or mutate agent work. See Building with agents.
{
"type": "AgentTimeline",
"props": {
"runId": "incident-14",
"title": "Checkout conversion drop",
"selectAction": "inspect_timeline_span",
"agents": [
{
"id": "lead",
"name": "Orchestrator",
"model": "Claude Opus 5.5",
"price": 8
},
{
"id": "analyst",
"name": "Analyst",
"model": "Claude Haiku 5.5",
"price": 0.2
}
],
"spans": [
{
"id": "plan",
"agentId": "lead",
"kind": "thinking",
"startMs": 0,
"endMs": 1400,
"label": "Split investigation tracks",
"tokens": 1200
}
],
"handoffs": []
},
"children": []
}