AgentSubagent

A child agent the root agent started, with the transcript it produced. Its messages and tool calls are held here and are not repeated in the root snapshot's messages and toolCalls.

import type { AgentSubagent } from '@threadplane/angular/chat';

Declaration

export interface AgentSubagent  {
  readonly description?: string;
  readonly error?: string;
  readonly id: string;
  readonly messages: readonly Message[];
  readonly name?: string;
  readonly parentId?: string;
  readonly state?: Readonly<Record<string, PlainValue>>;
  readonly status: AgentSubagentStatus;
  readonly streamingToolCalls?: readonly StreamingToolCall[];
  readonly toolCallId?: string;
  readonly toolCalls: readonly ToolCall[];
}

Members

description

The task the child was given, in the root agent's words.

readonly description?: string;

error

Display text for the failure when status is 'error' and the backend gave one.

readonly error?: string;

id

Stable for the life of the session.

readonly id: string;

messages

readonly messages: readonly Message[];

name

readonly name?: string;

parentId

The id of the child that started this one; absent for a child of the root agent.

readonly parentId?: string;

state

The child's own state as the backend last reported it, as frozen plain data. Never checked against the session's state declaration. Absent when the backend reports no state for children.

readonly state?: Readonly<Record<string, PlainValue>>;

status

readonly status: AgentSubagentStatus;

streamingToolCalls

The child's tool calls whose arguments are still streaming, when the session shows them.

readonly streamingToolCalls?: readonly StreamingToolCall[];

toolCallId

The root tool call that started this child, when the backend relates the two.

readonly toolCallId?: string;

toolCalls

The child's own tool calls, referenced by Message.toolCallIds in messages.

readonly toolCalls: readonly ToolCall[];