An agent run ended. Emitted once per run, from the run's own final state, by the agent's tracing; it carries the turn's conversation for backends that record it (Langfuse turns it into a trace with one span per message). A blocked turn has been removed from the thread by then, so a blocked run carries no messages.
Value parameters
- agent
-
the agent active when the run ended
- messages
-
this turn's messages, from its user message on; empty when blocked, cancelled, timed out or failed. Not included in toJson, which stays a flat summary.
- parentRunId
-
for a delegated child run, the parent run that started it;
Nonefor a top-level run - parentThreadId
-
for a delegated child run, the thread of the parent whose tool call started it;
Nonefor a top-level run - provider
-
the canonical id of the provider of the run's model calls (the first call's, when they used several), when its client reported one; OpenTelemetry's
gen_ai.provider.name - runId
-
this run
- span
-
the run's own span (design 4.58): its context, its parent - a child run's is the
tasktool call that started it, a continued run's the context it continued - and when the run started - status
-
completed,suspended,step_limit_reached,blocked:<guardrail>,cancelled,timed_outorfailed - threadId
-
the conversation's thread; backends use it as the session
- usage
-
this run's own token usage and cost, per model: the model calls the run made, never the thread's earlier runs, so a backend can report it per run (as OpenTelemetry's per-operation
gen_ai.usage.*) without double counting
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TraceEventclass Objecttrait Matchableclass Any