One of the following:
AgentSessionErrorEvent { error, event_id, session_id, 2 more }

Emitted when a turn or session fails.

error: SessionError { code, message, param, type }

The error that occurred.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
type: "error"

The type of the object. Always error.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentReadyEvent { environment, event_id, session_id, 3 more }

Emitted when a hosted session environment is ready to connect.

environment: AgentSessionEnvironmentState { id, error, status, type }

The current environment state.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.environment.ready"

The type of the object. Always agent.session.environment.ready.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentSuspendedEvent { environment, event_id, session_id, 3 more }

Emitted after an idle hosted session environment is checkpointed and stopped.

environment: AgentSessionEnvironmentState { id, error, status, type }

The current environment state.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.environment.suspended"

The type of the object. Always agent.session.environment.suspended.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentExpiredEvent { environment, event_id, session_id, 3 more }

Emitted after a suspended hosted session environment and its checkpoint expire.

environment: AgentSessionEnvironmentState { id, error, status, type }

The current environment state.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.environment.expired"

The type of the object. Always agent.session.environment.expired.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentResetEvent { environment_id, event_id, reset_count, 4 more }

Emitted after a hosted sandbox is replaced. Conversation history survives; changes to the previous sandbox’s files and processes do not.

environment_id: string

The stable environment ID, retained across sandbox replacements.

minLength0
event_id: string

The unique ID of the event.

minLength0
reset_count: number

Monotonically increasing reset number. Repeated notifications share this number.

formatint64
minimum0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The associated turn, when applicable.

minLength0
type: "agent.session.environment.reset"

The type of the object. Always agent.session.environment.reset.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentOutputCommandExecutionOutputDeltaEvent { delta, event_id, item_id, 5 more }

Emitted when command execution produces an output delta.

delta: string

The output text that was appended.

minLength0
event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the command execution item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.output.command_execution_output.delta"

The type of the object. Always agent.output.command_execution_output.delta.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionCreatedEvent { event_id, session, type, obfuscation }

Emitted when a session is created.

event_id: string

The unique ID of the event.

minLength0
session: AgentSession { id, agent, created_at, 11 more }

The session that was created.

type: "agent.session.created"

The type of the object. Always agent.session.created.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnCreatedEvent { event_id, session_id, turn, 3 more }

Emitted when a turn is created.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn: Turn { id, agent_id, completed_at, 9 more }

The turn at the time it was created.

turn_id: string

The ID of the turn associated with the event.

minLength0
type: "agent.session.turn.created"

The type of the object. Always agent.session.turn.created.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnInProgressEvent { event_id, session_id, turn, 3 more }

Emitted when a turn starts running.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn: Turn { id, agent_id, completed_at, 9 more }

The turn at the time it started running.

turn_id: string

The ID of the turn associated with the event.

minLength0
type: "agent.session.turn.in_progress"

The type of the object. Always agent.session.turn.in_progress.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnCompletedEvent { event_id, session_id, turn, 4 more }

Emitted when a turn completes.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn: Turn { id, agent_id, completed_at, 9 more }

The completed turn.

turn_id: string

The ID of the turn associated with the event.

minLength0
type: "agent.session.turn.completed"

The type of the object. Always agent.session.turn.completed.

usage: TokenUsage { input_tokens, input_tokens_details, output_tokens, 2 more } | null

Token usage by the root agent during the turn, when available.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnFailedEvent { event_id, session_id, turn, 4 more }

Emitted when a turn fails.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn: Turn { id, agent_id, completed_at, 9 more }

The failed turn.

turn_id: string

The ID of the turn associated with the event.

minLength0
type: "agent.session.turn.failed"

The type of the object. Always agent.session.turn.failed.

usage: TokenUsage { input_tokens, input_tokens_details, output_tokens, 2 more } | null

Token usage by the root agent during the turn, when available.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnCancelledEvent { event_id, session_id, turn, 4 more }

Emitted when a turn is cancelled.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn: Turn { id, agent_id, completed_at, 9 more }

The cancelled turn.

turn_id: string

The ID of the turn associated with the event.

minLength0
type: "agent.session.turn.cancelled"

The type of the object. Always agent.session.turn.cancelled.

usage: TokenUsage { input_tokens, input_tokens_details, output_tokens, 2 more } | null

Token usage by the root agent during the turn, when available.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnItemAddedEvent { event_id, item, output_index, 4 more }

Emitted when an item is added to a turn.

event_id: string

The unique ID of the event.

minLength0

The item that was added.

output_index: number | null

The index of the item in the turn output, when the item is agent output.

formatint64
minimum0
maximum4294967295
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.item.added"

The type of the object. Always agent.session.turn.item.added.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionIdleEvent { event_id, session, type, obfuscation }

Emitted when a session becomes idle.

event_id: string

The unique ID of the event.

minLength0
session: AgentSession { id, agent, created_at, 11 more }

The session that became idle.

type: "agent.session.idle"

The type of the object. Always agent.session.idle.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionInProgressEvent { event_id, session, type, obfuscation }

Emitted when a session starts processing a turn.

event_id: string

The unique ID of the event.

minLength0
session: AgentSession { id, agent, created_at, 11 more }

The session that started processing.

type: "agent.session.in_progress"

The type of the object. Always agent.session.in_progress.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionRequiresActionEvent { event_id, session, type, obfuscation }

Emitted when a session is waiting for one or more required actions.

event_id: string

The unique ID of the event.

minLength0
session: AgentSession { id, agent, created_at, 11 more }

The session and its current required actions.

type: "agent.session.requires_action"

The type of the object. Always agent.session.requires_action.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionFailedEvent { event_id, session, type, obfuscation }

Emitted when a session fails.

event_id: string

The unique ID of the event.

minLength0
session: AgentSession { id, agent, created_at, 11 more }

The failed session.

type: "agent.session.failed"

The type of the object. Always agent.session.failed.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentPendingEvent { environment, event_id, session_id, 3 more }

Emitted while a session environment is being prepared.

environment: AgentSessionEnvironmentState { id, error, status, type }

The current environment state.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.environment.pending"

The type of the object. Always agent.session.environment.pending.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentConnectedEvent { environment, event_id, session_id, 3 more }

Emitted when a session environment connects.

environment: AgentSessionEnvironmentState { id, error, status, type }

The current environment state.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.environment.connected"

The type of the object. Always agent.session.environment.connected.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentDisconnectedEvent { environment, event_id, session_id, 3 more }

Emitted when a session environment disconnects.

environment: AgentSessionEnvironmentState { id, error, status, type }

The current environment state.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.environment.disconnected"

The type of the object. Always agent.session.environment.disconnected.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionEnvironmentFailedEvent { environment, event_id, session_id, 3 more }

Emitted when a session environment fails.

environment: AgentSessionEnvironmentState { id, error, status, type }

The current environment state.

event_id: string

The unique ID of the event.

minLength0
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.environment.failed"

The type of the object. Always agent.session.environment.failed.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionSubagentCreatedEvent { event_id, subagent, type, obfuscation }

Emitted when a subagent is created.

event_id: string

The unique ID of the event.

minLength0
subagent: Subagent { id, closed_at, instructions, 6 more }

The subagent that was created.

type: "agent.session.subagent.created"

The type of the object. Always agent.session.subagent.created.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionSubagentActiveEvent { event_id, subagent, type, obfuscation }

Emitted when a closed subagent successfully resumes.

event_id: string

The unique ID of the event.

minLength0
subagent: Subagent { id, closed_at, instructions, 6 more }

The subagent that resumed.

type: "agent.session.subagent.active"

The type of the object. Always agent.session.subagent.active.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionSubagentClosedEvent { event_id, subagent, type, obfuscation }

Emitted when a subagent is closed.

event_id: string

The unique ID of the event.

minLength0
subagent: Subagent { id, closed_at, instructions, 6 more }

The subagent that was closed.

type: "agent.session.subagent.closed"

The type of the object. Always agent.session.subagent.closed.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnItemDoneEvent { event_id, item, output_index, 4 more }

Emitted when an output item is complete.

event_id: string

The unique ID of the event.

minLength0

The completed output item.

output_index: number

The index of the output item in the turn output.

formatint64
minimum0
maximum4294967295
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.item.done"

The type of the object. Always agent.session.turn.item.done.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnContentPartAddedEvent { content_index, event_id, item_id, 6 more }

Emitted when an output text content part is added.

content_index: number

The index of the content part in the message.

formatint64
minimum0
maximum4294967295
event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the message item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
part: OutputText { text, type }

The initial content part.

session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.content_part.added"

The type of the object. Always agent.session.turn.content_part.added.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnContentPartDoneEvent { content_index, event_id, item_id, 6 more }

Emitted when an output content part is complete.

content_index: number

The index of the content part in the message.

formatint64
minimum0
maximum4294967295
event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the message item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
part: OutputText { text, type }

The completed content part.

session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.content_part.done"

The type of the object. Always agent.session.turn.content_part.done.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnOutputTextDeltaEvent { content_index, delta, event_id, 6 more }

Emitted when text is appended to an output text content part.

content_index: number

The index of the content part in the message.

formatint64
minimum0
maximum4294967295
delta: string

The text that was appended.

minLength0
event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the message item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
session_id: string

The ID of the session associated with the event.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.output_text.delta"

The type of the object. Always agent.session.turn.output_text.delta.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnOutputTextDoneEvent { content_index, event_id, item_id, 6 more }

Emitted when an output text content part is complete.

content_index: number

The index of the content part in the message.

formatint64
minimum0
maximum4294967295
event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the message item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
session_id: string

The ID of the session associated with the event.

minLength0
text: string

The complete output text.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.output_text.done"

The type of the object. Always agent.session.turn.output_text.done.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnReasoningSummaryPartAddedEvent { event_id, item_id, output_index, 6 more }

Emitted when a reasoning summary content part is added.

event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the reasoning item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
part: SummaryText { text, type }

The initial summary part.

session_id: string

The ID of the session associated with the event.

minLength0
summary_index: number

The index of the summary content part.

formatint64
minimum0
maximum4294967295
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.reasoning_summary_part.added"

The type of the object. Always agent.session.turn.reasoning_summary_part.added.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnReasoningSummaryPartDoneEvent { event_id, item_id, output_index, 7 more }

Emitted when a reasoning summary part is complete.

event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the reasoning item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
part: SummaryText { text, type }

The completed summary part.

session_id: string

The ID of the session associated with the event.

minLength0
status: "incomplete" | null

Present as incomplete when summary generation was interrupted.

summary_index: number

The index of the summary part.

formatint64
minimum0
maximum4294967295
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.reasoning_summary_part.done"

The type of the object. Always agent.session.turn.reasoning_summary_part.done.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnReasoningSummaryTextDeltaEvent { delta, event_id, item_id, 6 more }

Emitted when text is appended to a reasoning summary.

delta: string

The summary text that was appended.

minLength0
event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the reasoning item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
session_id: string

The ID of the session associated with the event.

minLength0
summary_index: number

The index of the summary content part.

formatint64
minimum0
maximum4294967295
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.reasoning_summary_text.delta"

The type of the object. Always agent.session.turn.reasoning_summary_text.delta.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0
AgentSessionTurnReasoningSummaryTextDoneEvent { event_id, item_id, output_index, 6 more }

Emitted when a reasoning summary content part is complete.

event_id: string

The unique ID of the event.

minLength0
item_id: string

The ID of the reasoning item.

minLength0
output_index: number

The index of the item in the turn output.

formatint64
minimum0
maximum4294967295
session_id: string

The ID of the session associated with the event.

minLength0
summary_index: number

The index of the summary content part.

formatint64
minimum0
maximum4294967295
text: string

The complete reasoning summary text.

minLength0
turn_id: string | null

The ID of the turn associated with the event, when applicable.

minLength0
type: "agent.session.turn.reasoning_summary_text.done"

The type of the object. Always agent.session.turn.reasoning_summary_text.done.

obfuscation?: string

Random alphanumeric padding. Present when stream obfuscation is enabled.

minLength0