AgentRunEnded
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.
- runId
-
this run
- 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
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait TraceEventclass Objecttrait Matchableclass Any