Agent status

One line saying what an AI agent is doing right now: "Searching the workspace · refund policy, 3 of 7, 14s, Stop". Host-driven: the server renders the status, the label and the elapsed time, and a re-render (a Livewire poll or stream) changes them. No script.

This spec also holds the status set the five agent components share (reasoning, agent-status, tool-call, agent-plan, agent-timeline).

The status set

One set, one helper: Support\AgentState maps each status to its icon, its tone and its English word, and every agent component reads it from there.

StatusMeansIconToneWord
pendingnot startedellipsis-horizontal-circle, outlineneutralPending
runningunder waya spinner (ds::loader)accentIn progress
donefinishedcheck-circle, solidsuccessDone
failedfinished badlyx-circle, soliddangerFailed
cancelledstopped before the endno-symbol, outlineneutralCancelled
waitingneeds the reader (an approval, an answer)hand-raised, solidwarningWaiting for you

Anything else is pending, drawn rather than thrown, because a status is data from a run. The common spellings frameworks use for the same things are taken: in_progress, completed, succeeded, error, canceled, skipped, requires_action and the like, and a backed enum's value.

Never colour alone. Every status has an icon and a word. The mark (partials/agent-mark.blade.php) is decorative; every component writes the word beside it, visibly or visually hidden. statusText on each component replaces any of the words, as [status => words].

Tones are names in AgentState, never classes: src/ is not scanned by a consumer's Tailwind, so the mark partial turns a tone into classes from a literal list.

A mark that changes on a re-render (the spinner becoming a tick) grows in from @starting-style, motion-safe: only: CSS, no script. A morph that patches one icon's path into another's in place (done to failed) does not count as a new element and does not animate; every change out of or into running does, because the spinner and the icon are different elements.

Durations are formatted in PHP by AgentState::duration(): "12 seconds", "1 minute 4 seconds", "2 hours 5 minutes" in full, "12s", "1m 4s" short; under ten seconds keeps one decimal ("0.4s"). isoDuration() gives the datetime of a time element (PT1M4S).

Anatomy

span[data-ds-agent-status]                      pill | row | inline
├── span[role=status][aria-live=polite][aria-atomic=true]
│   ├── mark                                    aria-hidden
│   ├── span.sr-only  "In progress: "           unless the label is the word
│   ├── label                                   ds::shimmer while running
│   ├── detail                                  " · detail", or a second line in a row
│   └── steps  "3 of 7"
├── time[aria-hidden][datetime=PT14S] "14s"  +  span.sr-only "14 seconds"
└── Stop                                        while pending, running or waiting

Variants

VariantShape
pill (default)rounded-full, bordered, text-meta; fits its content
rowfull width, bordered, text-body, label over detail, a 20px mark
inlineno box, sits in a sentence

tone replaces the mark's colour; the word stays the status's.

Props

status, label (default: the status's word), detail, elapsed (seconds), variant, tone, cancelHref and cancelLabel ("Stop"), or a cancel slot for a button or a form; steps as a string ("3 of 7") or [3, 7] worded by stepsText (:current of :total); statusText.

States

Stop shows only while the status is live (pending, running, waiting). The elapsed time is the server's: there is no ticking clock, because the brief allowed one only by reusing an existing behaviour, and none ticks.

Accessibility

Rolestatus, aria-live="polite", aria-atomic="true", on the words only
Namenone needed: a live region's content is what is read
Announcementa new label, detail or steps is read once, whole
Elapsedoutside the region and aria-hidden, with a visually hidden text form beside it: a re-render that only moves the clock announces nothing
KeyboardTab to Stop, if shown; Enter follows it
FocusStop draws the system ring

The Stop control is outside the live region: a region is for words. Every wrapper is a span, so the inline variant is phrasing content and can sit in a paragraph.

Do not

  • Do not put the elapsed time inside the region. Every re-render would announce the whole line again.
  • Do not render it after the first status arrives. Render it from the start (pending), so the region exists before its words change.
  • Do not use colour alone for a status of your own; pass statusText for the words.

From the package repo: edit this page on GitHub.

Was this page helpful?