Light themes
Dark themes

Make your own

Trace

A trace shows what an agent did on the way to an answer: one line per step, with its state and how long it took.

Worked for 42 seconds, 5 steps
  1. Read orders-november.csv0.4 s
  2. Searched for "chilled delivery" in the notes1.2 s
  3. Ran the stock check8.0 s
  4. autumn batch: 412 packed, 280 reserved, 132 left
  5. Could not reach the courier's schedule30 s
  6. Writing the summary

Markup

HTML
<details class="tray-trace-group" open>
  <summary>…chevron-right… Worked for 42 seconds, 5 steps</summary>
  <ol class="tray-trace">
    <li class="tray-trace__line">
      <span class="tray-trace__icon">…icon…</span>
      <span class="tray-trace__title"><b>Read</b> orders-november.csv</span>
      <span class="tray-trace__meta">0.4 s</span>
    </li>
  </ol>
</details>

Each line is a 32px icon tile, a title that starts with a bold verb, and a time. A hairline joins the tiles.

StateMarkup
DoneThe default.
Runningdata-status="running", a Spinner in the tile, the verb in the present ("Writing the summary").
Faileddata-status="failed": the tile and the verb turn danger; say what failed in the title.
Denied or skippedPlain line with the verb "Denied" or "Skipped".

A step's output goes in tray-trace__detail under its line, usually a small Code Block inside a Collapsible. Wrap the whole trace in tray-trace-group, a disclosure that reads "Worked for 42 seconds, 5 steps": open while the work runs, closed once the answer is there.

Accessibility

The group is the browser's own <details>: Enter or Space on its summary opens and closes it, and a screen reader announces it as expanded or collapsed. The steps are an <ol>, so each line is read with its place, and the icons and the spinner in the tiles are aria-hidden. The words carry the state: a running step speaks in the present tense and a failed one says what failed, so the danger colour is never the only sign. The trace is not a live region, so steps added while it runs are not announced. Under prefers-reduced-motion: reduce the group opens at once instead of unfolding.

Do and don't

  • Do write each step as verb plus object: "Read orders.csv", "Searched for chilled delivery".
  • Do put a request for permission outside the trace, as an Item with Approve and Deny buttons; it is a question, not activity.
  • Don't show raw tool names or arguments as the title.
  • Don't keep a finished trace open over the answer.
↑↓ to moveEnter to openEsc to close