Skip to content

Interface: SubagentExecutionTrace

@providerprotocol/agents


@providerprotocol/agents / index / SubagentExecutionTrace

Defined in: src/state/types.ts:75

Sub-agent execution trace for checkpoint persistence and observability.

Records the complete execution history of a sub-agent spawned by the parent agent, including the task, timing, outcome, and all tool invocations. This enables hierarchical agent debugging and audit trails.

Conforms to UAP specification Section 8.8 for sub-agent execution tracing.

const trace: SubagentExecutionTrace = {
subagentId: 'sub-abc123',
subagentType: 'research-agent',
parentToolCallId: 'call-xyz789',
prompt: 'Find information about quantum computing',
startTime: Date.now(),
endTime: Date.now() + 5000,
success: true,
result: 'Quantum computing uses qubits...',
toolExecutions: [
{ toolName: 'web_search', arguments: { query: 'quantum computing' }, result: '...' }
],
usage: { inputTokens: 100, outputTokens: 200, totalTokens: 300 }
};

ToolExecutionTrace for individual tool execution records

endTime: number

Defined in: src/state/types.ts:92

Execution end timestamp in milliseconds since Unix epoch


optional error: string

Defined in: src/state/types.ts:101

Error message describing what went wrong (present when success is false)


parentToolCallId: string

Defined in: src/state/types.ts:83

Tool call ID from the parent agent that spawned this sub-agent


prompt: string

Defined in: src/state/types.ts:86

The task or prompt given to the sub-agent


optional result: string

Defined in: src/state/types.ts:98

The sub-agent’s final response (present when success is true)


startTime: number

Defined in: src/state/types.ts:89

Execution start timestamp in milliseconds since Unix epoch


subagentId: string

Defined in: src/state/types.ts:77

Unique identifier for this sub-agent instance


subagentType: string

Defined in: src/state/types.ts:80

Type or name identifying the sub-agent’s role or capabilities


success: boolean

Defined in: src/state/types.ts:95

Whether the sub-agent completed its task successfully


optional toolExecutions: ToolExecutionTrace[]

Defined in: src/state/types.ts:104

Ordered list of tool executions performed by the sub-agent


optional usage: TokenUsage

Defined in: src/state/types.ts:107

Token usage statistics for the sub-agent’s LLM calls