Skip to content

AgentSpan

attributes: object;
Name Type Description

activeFlow?

string

agentEntityId?

string

agentId?

string

Agent active when the span opened; a turn span keeps its initiating agent across handoffs.

agentVersionId?

string

artifactDigest?

string

branch?

string

cacheReadTokens?

number

Prompt-cache read tokens for this turn (delta).

cacheWriteTokens?

number

Prompt-cache write / creation tokens for this turn (delta).

configGeneration?

number

contextTokens?

number

Context-window occupancy at this turn (last prompt tokens — a snapshot, not a delta).

controlPath?

boolean

Out-of-node routing / decide / guard model call.

environment?

string

error?

string

finishReason?

string

Finish reason from the model call (llm spans).

handoffFrom?

string

handoffTo?

string

imperative?

boolean

Imperative ctx.tool call (not model-issued).

input?

unknown

inputTokens?

number

Per-call input tokens on llm spans (sum must reconcile to turn tokensIn).

modelId?

string

Model id on llm spans (llm:${modelId}).

nodeId?

string

output?

unknown

outputTokens?

number

Per-call output tokens on llm spans.

releaseId?

string

rendered?

"model" | "engine"

How a reply node’s user-facing text was produced. Token accounting reads this.

runtimeRevisionId?

string

secretGeneration?

number

sessionId

string

skillContentHash?

string

SHA-256 of the initiating agent’s validated skill snapshot.

skillContentHashes?

Record<string, string>

Skill snapshot hashes observed across all agents in this turn, including handoffs.

slotSources?

Record<string, "deterministic" | "model">

How each collect slot was filled this node (deterministic = tier 0, model = extraction).

step?

number

0-based model-call index within the enclosing node loop (llm spans).

tenantId?

string

Immutable publication/runtime identity. Copied to every span in the turn.

tokensIn?

number

Input tokens consumed by this turn (delta — for cost attribution).

tokensOut?

number

Output tokens generated by this turn (delta — for cost attribution).

toolName?

string

ttftMs?

number

Milliseconds from Runtime.run() trace start to the first non-empty client text delta.


optional endTime?: number;

optional events?: object[];
Name Type

attributes?

Record<string, unknown>

name

string

time

number


kind: SpanKind;

name: string;

optional parentSpanId?: string;

spanId: string;

startTime: number;

status: "error" | "ok";

traceId: string;