{#if trace?.live}{/if} {trace?.title || (failure ? 'trace' : 'reading the trace…')} {#if trace?.follows}and every turn after{/if}
{#if trace && time}
{#each parts as part (part.kind)} {/each}
{#each named as part (part.kind)} {part.label} {span(part.ms)} {/each} {#if sums} {span((until ?? trace.end) - trace.start)} · {count(sums.input + sums.output)} tokens · {sums.calls} model {sums.calls === 1 ? 'call' : 'calls'} · {sums.tools} {sums.tools === 1 ? 'tool call' : 'tool calls'}{#if sums.errors} · {sums.errors} failed{/if} {/if}
{/if} {#if failure && !trace}

(。•︿•。) couldn't read this trace: {failure}

{:else if !trace} {:else if !steps.length}

(・_・ ) nothing ran in this turn

{:else}
{#if !oldest && onearlier} {/if}
{#each ticks as tick (tick.value)} {label(tick.value)} {/each} {#each clock?.breaks ?? [] as gap (gap.at)} {#if !answered(gap)} {span(gap.idle)} idle {/if} {/each} {#each trace.marks as mark, index (index)} {@const waited = clock?.breaks.find((gap) => answered(gap) && Math.abs(gap.at + gap.width - fraction(mark.at)) * width < 60)} you {/each} {#if zoom > 1.01} {/if}
{#each trace.lanes as lane (lane.id)} {@const context = contexts.get(lane.id)}
{lane.name} {lane.model} {#if context} {count(context.last)} ctx{#if context.share >= 0.05} · {Math.round(context.share * 100)}% cached{/if} {/if}
{#if clusters.get(lane.id)?.length}
{#each clusters.get(lane.id) ?? [] as cluster (cluster.key)} {@const one = cluster.steps.length === 1 ? cluster.steps[0] : null} {/each}
{/if} {#if jobs.get(lane.id)?.length} {@const placed = jobs.get(lane.id) ?? []} {@const tracks = Math.max(...placed.map((item) => item.track)) + 1}
1} class:open={tracks > 1 && unfolded === lane.id} style:--tracks={tracks} role="group" aria-label="jobs" onpointerenter={() => (unfolded = lane.id)} onpointerleave={() => unfolded === lane.id && (unfolded = null)} onfocusin={() => (unfolded = lane.id)} onfocusout={(event) => !(event.currentTarget as HTMLElement).contains(event.relatedTarget as Node) && unfolded === lane.id && (unfolded = null)} > {#each placed as { job, track } (job.id)} {/each}
{/if}
{#if chosen && chosen.lane === lane.id} {@const content = bodies.get(chosen.id)}
{chosen.kind === 'waiting' ? `waiting for ${nameOf(trace.lanes.find((other) => other.parent === lane.id)?.id ?? '')}` : chosen.name} {chosen.open ? 'running for' : 'took'} {span(chosen.end - chosen.start)} · at {label(chosen.start - trace.start)}
{#if chosen.kind === 'model'}
{#if chosen.detail !== chosen.name}
model
{chosen.detail}
{/if} {#if chosen.firstByte}
first byte
{span(chosen.firstByte - chosen.start)}
{/if} {#if chosen.input !== undefined}
sent
{count(chosen.input)} tokens
{/if} {#if chosen.cached}
from cache
{count(chosen.cached)} ({Math.round((chosen.cached / Math.max(1, chosen.input ?? 1)) * 100)}%)
{/if} {#if chosen.output !== undefined}
wrote
{count(chosen.output)} tokens
{/if}
{#if chosen.error}

{chosen.error}

{/if} {:else if chosen.kind === 'tool'} {@const did = chipsOf(chosen).filter((chip) => chip.kind !== 'code')} {#if did.length}
    {#each did as chip, index (index)} {@const turn = chosen.turn}
  • {#if chip.path && turn && onreview} {:else} {@render glyph(chip.kind)} {chip.verb} {chip.target} {#if chip.ms !== undefined}{span(chip.ms)}{/if} {/if}
  • {/each}
{/if} {#if content === 'loading' || content === undefined}

reading the call…

{:else if content === 'gone'}

this call's content could not be read

{:else} {#if content.code}
{content.code}
{/if} {#if content.output}
{content.output}
{:else if !chosen.open}

no output

{/if} {/if} {:else}

nothing ran here while an agent below worked.

{/if}
{/if} {/each}
{/if} {#if hovered} {@const step = hovered.step} {/if}
{#snippet glyph(kind: string)} {/snippet}