RunState
Serializable snapshot of an agent’s run, including context, usage and trace.
While this class has publicly writable properties (prefixed with _), they are not meant to be
used directly. To read these properties, use the RunResult instead.
Manipulation of the state directly can lead to unexpected behavior and should be avoided.
Instead, use the approve and reject methods to interact with the state.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
|
|
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new RunState<TContext, TAgent>( context, originalInput, startingAgent,maxTurns): RunState<TContext, TAgent>;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
| |
|
|
|
|
|
|
Returns
Section titled “Returns”RunState<TContext, TAgent>
Properties
Section titled “Properties”_agentToolInvocation
Section titled “_agentToolInvocation”_agentToolInvocation: | Readonly<{ toolArguments?: string; toolCallId?: string; toolName: string;}> | undefined;Runtime-only metadata for the current nested agent-tool invocation.
_ambiguousToolInvocationCallIds
Section titled “_ambiguousToolInvocationCallIds”_ambiguousToolInvocationCallIds: Map<Agent<any, any>, Set<string>>;Legacy call IDs whose serialized history cannot identify one canonical invocation.
_completedToolInvocationEvidence
Section titled “_completedToolInvocationEvidence”_completedToolInvocationEvidence: Map<Agent<any, any>, Map<string, ToolInvocationCompletionEvidence>>;Completed invocations whose supporting run items were removed by a supported history replacement.
_completedToolInvocations
Section titled “_completedToolInvocations”_completedToolInvocations: Map<Agent<any, any>, Map<string, string>>;Canonical invocation fingerprints whose local tool outputs are committed to run history.
_context
Section titled “_context”_context: RunContext<TContext>;Run context tracking approvals, usage, and other metadata.
_conversationId
Section titled “_conversationId”_conversationId: string | undefined;Conversation identifier when the server manages conversation history.
_currentAgent
Section titled “_currentAgent”_currentAgent: TAgent;The agent currently handling the conversation.
_currentAgentSpan
Section titled “_currentAgentSpan”_currentAgentSpan: | Span<AgentSpanData> | undefined;Active tracing span for the current agent if tracing is enabled.
_currentStep
Section titled “_currentStep”_currentStep: | { newAgent: any; type: "next_step_handoff";} | { localFinalizationStarted?: true; output: string; responseAccepted?: true; type: "next_step_final_output";} | { type: "next_step_run_again";} | { data: Record<string, any>; type: "next_step_interruption";} | undefined = undefined;Next step computed for the agent to take.
_currentTurn
Section titled “_currentTurn”_currentTurn: number = 0;Current turn number in the conversation.
_currentTurnBlockedSessionStartIndex
Section titled “_currentTurnBlockedSessionStartIndex”_currentTurnBlockedSessionStartIndex: number | undefined;First current-turn index governed by the sparse blocked-output session suffix.
_currentTurnDeferredSessionItemIndexes
Section titled “_currentTurnDeferredSessionItemIndexes”_currentTurnDeferredSessionItemIndexes: Set<number>;Current-turn item indexes intentionally deferred when a blocked output persisted only a replay-safe subset. A later accepted resume replaces the sparse suffix in original order.
_currentTurnInProgress
Section titled “_currentTurnInProgress”_currentTurnInProgress: boolean = false;Whether the current turn has already been counted (useful when resuming mid-turn).
_currentTurnPersistedItemCount
Section titled “_currentTurnPersistedItemCount”_currentTurnPersistedItemCount: number;Number of _generatedItems already flushed to session storage for the current turn.
Persisting the entire turn on every save would duplicate responses and tool outputs.
Instead, saveToSession appends only the delta since the previous write. This counter
tracks how many generated run items from this turn were already written so the next
save can slice off only the new entries. When a turn is interrupted (e.g., awaiting tool
approval) and later resumed, we rewind the counter before continuing so the pending tool
output still gets stored.
_currentTurnSessionHistoryTransactionCanReplaceAcceptedOutput
Section titled “_currentTurnSessionHistoryTransactionCanReplaceAcceptedOutput”_currentTurnSessionHistoryTransactionCanReplaceAcceptedOutput: boolean | undefined;Whether the current live batch may later replace its sparse suffix with accepted output.
_currentTurnSessionHistoryTransactionInputItems
Section titled “_currentTurnSessionHistoryTransactionInputItems”_currentTurnSessionHistoryTransactionInputItems: | AgentInputItem[] | undefined;Normalized session input frozen before the current transaction-aware model request.
_currentTurnSessionHistoryTransactionSessionId
Section titled “_currentTurnSessionHistoryTransactionSessionId”_currentTurnSessionHistoryTransactionSessionId: string | undefined;Logical session bound to the current turn before a transaction-aware tool effect can occur.
_currentTurnSessionReasoningItemIdPolicy
Section titled “_currentTurnSessionReasoningItemIdPolicy”_currentTurnSessionReasoningItemIdPolicy: | ReasoningItemIdPolicy | undefined;Effective reasoning-item ID policy frozen for the current transaction-aware session turn.
_currentTurnSessionWriteCompactedItemCount
Section titled “_currentTurnSessionWriteCompactedItemCount”_currentTurnSessionWriteCompactedItemCount: number | undefined;Persisted-item count whose resumed-write recovery input compaction has settled.
_finalOutputSource
Section titled “_finalOutputSource”_finalOutputSource: FinalOutputSource | undefined;Indicates how the final output was produced for the current run. This value is not serialized.
_generatedItems
Section titled “_generatedItems”_generatedItems: RunItem[];Items generated by the agent during the run.
_inputGuardrailResults
Section titled “_inputGuardrailResults”_inputGuardrailResults: InputGuardrailResult[];Results from input guardrails applied to the run.
_lastModelSettings
Section titled “_lastModelSettings”_lastModelSettings: | ModelSettings | undefined;Effective model settings used for the most recent model call.
_lastProcessedResponse
Section titled “_lastProcessedResponse”_lastProcessedResponse: ProcessedResponse<TContext> | undefined = undefined;Parsed model response after applying guardrails and tools.
_lastTurnResponse
Section titled “_lastTurnResponse”_lastTurnResponse: | ModelResponse | undefined;Last model response for the previous turn.
_maxTurns
Section titled “_maxTurns”_maxTurns: number | null;Maximum allowed turns before forcing termination.
_modelResponses
Section titled “_modelResponses”_modelResponses: ModelResponse[];Responses from the model so far.
_noActiveAgentRun
Section titled “_noActiveAgentRun”_noActiveAgentRun: boolean = true;Whether the run has an active agent step in progress.
_observedToolInvocations
Section titled “_observedToolInvocations”_observedToolInvocations: Map<Agent<any, any>, Map<string, string>>;Canonical invocations observed in the active run before their outputs are committed.
_originalInput
Section titled “_originalInput”_originalInput: | string | AgentInputItem[];Original user input prior to any processing.
_outputGuardrailResults
Section titled “_outputGuardrailResults”_outputGuardrailResults: OutputGuardrailResult<any, any>[];Results from output guardrails applied to the run.
_pendingAgentToolRunAliases
Section titled “_pendingAgentToolRunAliases”_pendingAgentToolRunAliases: Map<string, string>;Legacy pending-run keys mapped to their canonical category-aware keys.
_pendingAgentToolRuns
Section titled “_pendingAgentToolRuns”_pendingAgentToolRuns: Map<string, string>;Serialized pending nested agent runs keyed by tool name and call id.
_pendingInput
Section titled “_pendingInput”_pendingInput: AgentInputItem[];Input staged for admission immediately before the next resumed model call.
_pendingLegacyCompactionSessionItems
Section titled “_pendingLegacyCompactionSessionItems”_pendingLegacyCompactionSessionItems: | AgentInputItem[] | undefined;Compaction marker and persisted suffix that an ordinary session must reconcile once after a pre-1.16 snapshot is restored. The field remains serialized until reconciliation succeeds.
_pendingSessionHistoryTransaction
Section titled “_pendingSessionHistoryTransaction”_pendingSessionHistoryTransaction: | { alreadyPersistedCount: number; deferredItemIndexes: number[]; operationId: string; persistedItemCount: number; replaceRunItemIndexes: number[]; runItemIndexes: number[]; transactionKind: "blocked_append" | "accepted_replace";} | undefined;Transaction reconstruction data awaiting confirmation from the session backend. Its generated-item indexes, operation identity, and post-commit bookkeeping remain stable across retries on the same live RunState; input stays in the separately frozen current-turn snapshot.
_pendingSessionWrite
Section titled “_pendingSessionWrite”_pendingSessionWrite: | { alreadyPersistedCount: number; handoffInput?: { generatedItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | ...[]; id?: string; providerData?: Record<..., ...>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<..., ...>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; } | { id?: string; providerData?: Record<..., ...>; type: "unknown"; }; type: "input_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: ( | { providerData?: ...; refusal: ...; type: ...; } | { providerData?: ...; text: ...; type: ...; } | { audio: ...; format?: ...; promptCacheBreakpoint?: ...; providerData?: ...; transcript?: ...; type: ...; } | { image: ...; providerData?: ...; type: ...; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item"; } | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; type: "tool_call_item"; } | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; }; type: "tool_call_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; }; type: "reasoning_item"; } | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; }; type: "compaction_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item"; } | { rawItem: { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item"; })[]; originalInput: | string | ( | { content: ( | { providerData?: ...; refusal: ...; type: ...; } | { providerData?: ...; text: ...; type: ...; } | { audio: ...; format?: ...; promptCacheBreakpoint?: ...; providerData?: ...; transcript?: ...; type: ...; } | { image: ...; providerData?: ...; type: ...; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | (... | ... | ... | ...)[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; }; actions?: (... | ... | ... | ... | ... | ... | ... | ... | ...)[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<..., ...>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: ... | ...; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; })[]; }; persistedItemCount: number; phase: "prepared"; reasoningItemIdPolicy: "omit" | "preserve"; sessionId: string; terminalToolFinalization?: { behavior: "function" | "stop_on_first_tool" | "stop_at_tool_names"; finalOutput: string; selectedCallId?: string; selectedGeneratedItemIndex?: number; };} | { alreadyPersistedCount: number; beforeItems: ( | { content: ( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; promptCacheBreakpoint?: { mode: "explicit"; }; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: | string | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<...>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<...>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; })[]; comparableAppendItems: ( | { content: ( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; promptCacheBreakpoint?: { mode: "explicit"; }; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: | string | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<...>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<...>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; })[]; handoffInput?: { generatedItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | ...[]; id?: string; providerData?: Record<..., ...>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<..., ...>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; } | { id?: string; providerData?: Record<..., ...>; type: "unknown"; }; type: "input_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: ( | { providerData?: ...; refusal: ...; type: ...; } | { providerData?: ...; text: ...; type: ...; } | { audio: ...; format?: ...; promptCacheBreakpoint?: ...; providerData?: ...; transcript?: ...; type: ...; } | { image: ...; providerData?: ...; type: ...; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item"; } | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; type: "tool_call_item"; } | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; }; type: "tool_call_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; }; type: "reasoning_item"; } | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; }; type: "compaction_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item"; } | { rawItem: { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item"; })[]; originalInput: | string | ( | { content: ( | { providerData?: ...; refusal: ...; type: ...; } | { providerData?: ...; text: ...; type: ...; } | { audio: ...; format?: ...; promptCacheBreakpoint?: ...; providerData?: ...; transcript?: ...; type: ...; } | { image: ...; providerData?: ...; type: ...; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | (... | ... | ... | ...)[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; }; actions?: (... | ... | ... | ... | ... | ... | ... | ... | ...)[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<..., ...>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: ... | ...; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; })[]; }; persistedItemCount: number; phase: "append_ready"; reasoningItemIdPolicy: "omit" | "preserve"; sessionId: string; terminalToolFinalization?: { behavior: "function" | "stop_on_first_tool" | "stop_at_tool_names"; finalOutput: string; selectedCallId?: string; selectedGeneratedItemIndex?: number; };} | { alreadyPersistedCount: number; handoffInput?: { generatedItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | ...[]; id?: string; providerData?: Record<..., ...>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<..., ...>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; } | { id?: string; providerData?: Record<..., ...>; type: "unknown"; }; type: "input_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: ( | { providerData?: ...; refusal: ...; type: ...; } | { providerData?: ...; text: ...; type: ...; } | { audio: ...; format?: ...; promptCacheBreakpoint?: ...; providerData?: ...; transcript?: ...; type: ...; } | { image: ...; providerData?: ...; type: ...; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item"; } | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; type: "tool_call_item"; } | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; }; type: "tool_call_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; }; type: "reasoning_item"; } | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; }; type: "compaction_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item"; } | { rawItem: { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item"; })[]; originalInput: | string | ( | { content: ( | { providerData?: ...; refusal: ...; type: ...; } | { providerData?: ...; text: ...; type: ...; } | { audio: ...; format?: ...; promptCacheBreakpoint?: ...; providerData?: ...; transcript?: ...; type: ...; } | { image: ...; providerData?: ...; type: ...; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | (... | ... | ... | ...)[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; }; actions?: (... | ... | ... | ... | ... | ... | ... | ... | ...)[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<..., ...>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: ... | ...; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; })[]; }; persistedItemCount: number; phase: "compaction_pending"; reasoningItemIdPolicy: "omit" | "preserve"; sessionId: string; terminalToolFinalization?: { behavior: "function" | "stop_on_first_tool" | "stop_at_tool_names"; finalOutput: string; selectedCallId?: string; selectedGeneratedItemIndex?: number; };} | undefined;Ordinary Session append whose outcome must be reconciled before another resumed model call.
_previousResponseId
Section titled “_previousResponseId”_previousResponseId: string | undefined;Latest response identifier returned by the server for server-managed conversations.
_reasoningItemIdPolicy
Section titled “_reasoningItemIdPolicy”_reasoningItemIdPolicy: | ReasoningItemIdPolicy | undefined;Runtime options that control how run items are converted into model turn input. This value is serialized so resumed runs keep the same turn-input behavior.
_resumedSessionWriteInProgress
Section titled “_resumedSessionWriteInProgress”_resumedSessionWriteInProgress: boolean;Prevents two live resume attempts from executing or reconciling the same resumed Session append concurrently.
_sandbox
Section titled “_sandbox”_sandbox: | { backendId: string; currentAgentKey: string; currentAgentName: string; sessionsByAgent: Record<string, { backendId: string; currentAgentKey: string; currentAgentName: string; preservedOwnedSession?: boolean; requiresFreshCreation?: boolean; reuseLiveSession?: boolean; sessionState: { backendId: string; exposedPorts?: Record<string, any>; manifest: Record<string, any>; providerState: Record<string, any>; snapshot?: Record<string, any> | null; snapshotFingerprint?: string | null; snapshotFingerprintVersion?: string | null; version: 1 | 2 | 3 | 4 | 5; workspaceReady: boolean; }; }>; sessionState: { backendId: string; exposedPorts?: Record<string, any>; manifest: Record<string, any>; providerState: Record<string, any>; snapshot?: Record<string, any> | null; snapshotFingerprint?: string | null; snapshotFingerprintVersion?: string | null; version: 1 | 2 | 3 | 4 | 5; workspaceReady: boolean; };} | undefined = undefined;Persisted sandbox session metadata for sandbox-agent resume.
_serializedCurrentStep
Section titled “_serializedCurrentStep”_serializedCurrentStep: | { newAgent: any; type: "next_step_handoff";} | { localFinalizationStarted?: true; output: string; responseAccepted?: true; type: "next_step_final_output";} | { type: "next_step_run_again";} | { data: Record<string, any>; type: "next_step_interruption";} | undefined;Current step reconstructed from serialized state. This reference is not serialized and is cleared implicitly when the live runner installs another step.
_sessionHistoryTransactionId
Section titled “_sessionHistoryTransactionId”_sessionHistoryTransactionId: string;Stable per-run identifier used to derive idempotent session history transaction IDs.
_toolInputGuardrailResults
Section titled “_toolInputGuardrailResults”_toolInputGuardrailResults: ToolInputGuardrailResult[];Results from tool input guardrails applied during tool execution.
_toolOutputGuardrailResults
Section titled “_toolOutputGuardrailResults”_toolOutputGuardrailResults: ToolOutputGuardrailResult[];Results from tool output guardrails applied during tool execution.
_toolSearchRuntimeToolsByAgent
Section titled “_toolSearchRuntimeToolsByAgent”_toolSearchRuntimeToolsByAgent: Map<Agent<any, any>, ToolSearchRuntimeToolState<TContext>>;Runtime-only tool_search-loaded tools, scoped by agent object and preserved across turns for the lifetime of this in-memory run.
_toolUseTracker
Section titled “_toolUseTracker”_toolUseTracker: AgentToolUseTracker;Tracks what tools each agent has used.
_trace
Section titled “_trace”_trace: Trace | null = null;Trace associated with this run if tracing is enabled.
Accessors
Section titled “Accessors”currentAgent
Section titled “currentAgent”Get Signature
Section titled “Get Signature”get currentAgent(): TAgent;Returns the agent currently handling the run.
Returns
Section titled “Returns”TAgent
history
Section titled “history”Get Signature
Section titled “Get Signature”get history(): AgentInputItem[];The history of the agent run. This includes the input items and the new items generated during the run.
This can be used as inputs for the next agent run.
Returns
Section titled “Returns”pendingInput
Section titled “pendingInput”Get Signature
Section titled “Get Signature”get pendingInput(): AgentInputItem[];Returns a copy of input staged for the next resumed model call.
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get usage(): Usage;The usage aggregated for this run. This includes per-request breakdowns when available.
Returns
Section titled “Returns”Methods
Section titled “Methods”addInput()
Section titled “addInput()”addInput(input): void;Stages input for admission immediately before the next resumed model call.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
| |
Returns
Section titled “Returns”void
approve()
Section titled “approve()”approve(approvalItem, options?): void;Approves a tool call requested by the agent through an interruption and approval item request.
To approve the request use this method and then run the agent again with the same state object to continue the execution.
By default it will only approve the current tool call. To allow the tool to be used multiple
times throughout the run, set the alwaysApprove option to true.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
The tool call approval item to approve. |
|
|
|
{ |
Options for the approval. |
|
|
|
Approve this tool for all future calls in this run. |
Returns
Section titled “Returns”void
clearPendingAgentToolRun()
Section titled “clearPendingAgentToolRun()”clearPendingAgentToolRun(toolName, callId): void;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”void
clearPendingInput()
Section titled “clearPendingInput()”clearPendingInput(): void;Removes all input staged for the next resumed model call.
Returns
Section titled “Returns”void
clearTrace()
Section titled “clearTrace()”clearTrace(): void;Clears the restored trace and current agent span from this run state.
Use this before resuming a serialized state when the resumed run should attach to the current ambient trace instead of the trace persisted in the state.
Returns
Section titled “Returns”void
getInterruptions()
Section titled “getInterruptions()”getInterruptions(): RunToolApprovalItem[];Returns all interruptions if the current step is an interruption otherwise returns an empty array.
Returns
Section titled “Returns”getPendingAgentToolRun()
Section titled “getPendingAgentToolRun()”getPendingAgentToolRun(toolName, callId): string | undefined;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”string | undefined
getToolSearchRuntimeTools()
Section titled “getToolSearchRuntimeTools()”getToolSearchRuntimeTools(agent): Tool<TContext>[];Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”Tool<TContext>[]
getToolSearchRuntimeToolsForOutput()
Section titled “getToolSearchRuntimeToolsForOutput()”getToolSearchRuntimeToolsForOutput(agent, toolSearchOutput): Tool<TContext>[];Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
‐ |
|
|
{ |
‐ |
|
|
|
‐ |
|
|
|
‐ |
|
|
|
‐ |
|
|
|
An ID to identify the item. This is optional by default. If a model provider absolutely requires this field, it will be validated on the model level. |
|
|
|
Additional optional provider specific data. Used for custom functionality or model provider specific fields. |
|
|
|
‐ |
|
|
|
‐ |
|
|
|
SDK-only discovery attribution, excluded from provider requests. Names must identify the same logical Agent across reused history. Missing or ambiguous ownership requires a new search; this field does not grant tool execution permissions. |
|
|
|
‐ |
Returns
Section titled “Returns”Tool<TContext>[]
hasPendingAgentToolRun()
Section titled “hasPendingAgentToolRun()”hasPendingAgentToolRun(toolName, callId): boolean;Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”boolean
recordToolSearchRuntimeTools()
Section titled “recordToolSearchRuntimeTools()”recordToolSearchRuntimeTools( agent, toolSearchOutput, tools): void;Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
‐ |
|
|
{ |
‐ |
|
|
|
‐ |
|
|
|
‐ |
|
|
|
‐ |
|
|
|
An ID to identify the item. This is optional by default. If a model provider absolutely requires this field, it will be validated on the model level. |
|
|
|
Additional optional provider specific data. Used for custom functionality or model provider specific fields. |
|
|
|
‐ |
|
|
|
‐ |
|
|
|
SDK-only discovery attribution, excluded from provider requests. Names must identify the same logical Agent across reused history. Missing or ambiguous ownership requires a new search; this field does not grant tool execution permissions. |
|
|
|
‐ |
|
|
|
‐ |
Returns
Section titled “Returns”void
reject()
Section titled “reject()”reject(approvalItem, options?): void;Rejects a tool call requested by the agent through an interruption and approval item request.
To reject the request use this method and then run the agent again with the same state object to continue the execution.
By default it will only reject the current tool call. To reject the tool for all future
calls throughout the run, set the alwaysReject option to true.
When message is provided, it is used as the rejection text sent to the model.
Otherwise, toolErrorFormatter (if configured) or the SDK default is used.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
The tool call approval item to reject. |
|
|
|
{ |
Options for the rejection. |
|
|
|
Reject this tool for all future calls in this run. |
|
|
|
The rejection text sent to the model.
If not provided, |
Returns
Section titled “Returns”void
resetTurnPersistence()
Section titled “resetTurnPersistence()”resetTurnPersistence(): void;Resets the counter that tracks how many items were persisted for the current turn.
Returns
Section titled “Returns”void
rewindTurnPersistence()
Section titled “rewindTurnPersistence()”rewindTurnPersistence(count): void;Rewinds the persisted item counter when pending approvals require re-writing outputs.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”void
setConversationContext()
Section titled “setConversationContext()”setConversationContext(conversationId?, previousResponseId?): void;Updates server-managed conversation identifiers as a single operation.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”void
setCurrentAgent()
Section titled “setCurrentAgent()”setCurrentAgent(agent): void;Switches the active agent handling the run.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
Returns
Section titled “Returns”void
setCurrentAgentSpan()
Section titled “setCurrentAgentSpan()”setCurrentAgentSpan(span?): void;Updates the agent span associated with the current run.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”void
setPendingAgentToolRun()
Section titled “setPendingAgentToolRun()”setPendingAgentToolRun( toolName, callId, serializedState, aliases?): void;Parameters
Section titled “Parameters”| Parameter | Type | Default value |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readonly |
|
Returns
Section titled “Returns”void
setReasoningItemIdPolicy()
Section titled “setReasoningItemIdPolicy()”setReasoningItemIdPolicy(policy?): void;Updates runtime options for converting run items into turn input.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
Returns
Section titled “Returns”void
toJSON()
Section titled “toJSON()”toJSON(options?): object;Serializes the run state. By default, tracing API keys are omitted to prevent
accidental persistence of secrets. Pass includeTracingApiKey: true only when you
intentionally need to migrate a run along with its tracing credentials (e.g., to
rehydrate in a separate process that lacks the original environment variables).
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
{ |
|
|
|
Returns
Section titled “Returns”object
$schemaVersion
Section titled “$schemaVersion”$schemaVersion: | "1.0" | "1.1" | "1.2" | "1.3" | "1.4" | "1.5" | "1.6" | "1.7" | "1.8" | "1.9" | "1.10" | "1.11" | "1.12" | "1.13" | "1.14" | "1.15" | "1.16" | "1.17" | "1.18" | "1.19" | "1.20";ambiguousToolInvocationCallIds?
Section titled “ambiguousToolInvocationCallIds?”optional ambiguousToolInvocationCallIds?: object[];completedToolInvocationEvidence?
Section titled “completedToolInvocationEvidence?”optional completedToolInvocationEvidence?: object[];completedToolInvocations?
Section titled “completedToolInvocations?”optional completedToolInvocations?: object[];context
Section titled “context”context: object;context.approvalInvocations?
Section titled “context.approvalInvocations?”optional approvalInvocations?: object[];context.approvals
Section titled “context.approvals”approvals: Record<string, { approved: boolean | string[]; messages?: Record<string, string>; rejected: boolean | string[]; stickyRejectMessage?: string;}>;context.context
Section titled “context.context”context: Record<string, any>;context.functionApprovals?
Section titled “context.functionApprovals?”optional functionApprovals?: object[];context.hostedMcpApprovals?
Section titled “context.hostedMcpApprovals?”optional hostedMcpApprovals?: Record<string, { approved: boolean | string[]; messages?: Record<string, string>; rejected: boolean | string[]; stickyRejectMessage?: string;}>;context.legacyFunctionApprovals?
Section titled “context.legacyFunctionApprovals?”optional legacyFunctionApprovals?: Record<string, { approved: boolean | string[]; messages?: Record<string, string>; rejected: boolean | string[]; stickyRejectMessage?: string;}>;context.toolInput?
Section titled “context.toolInput?”optional toolInput?: any;context.usage
Section titled “context.usage”usage: object = usageSchema;context.usage.inputTokens
Section titled “context.usage.inputTokens”inputTokens: number;context.usage.inputTokensDetails?
Section titled “context.usage.inputTokensDetails?”optional inputTokensDetails?: Record<string, number>[];context.usage.outputTokens
Section titled “context.usage.outputTokens”outputTokens: number;context.usage.outputTokensDetails?
Section titled “context.usage.outputTokensDetails?”optional outputTokensDetails?: Record<string, number>[];context.usage.requests
Section titled “context.usage.requests”requests: number;context.usage.requestUsageEntries?
Section titled “context.usage.requestUsageEntries?”optional requestUsageEntries?: object[];context.usage.totalTokens
Section titled “context.usage.totalTokens”totalTokens: number;conversationId?
Section titled “conversationId?”optional conversationId?: string;currentAgent
Section titled “currentAgent”currentAgent: object = serializedAgentSchema;currentAgent.identity?
Section titled “currentAgent.identity?”optional identity?: string;currentAgent.name
Section titled “currentAgent.name”name: string;currentAgentSpan?
Section titled “currentAgentSpan?”optional currentAgentSpan?: SerializedSpanType | null;currentResponseGeneratedItemOwnership?
Section titled “currentResponseGeneratedItemOwnership?”optional currentResponseGeneratedItemOwnership?: object;currentResponseGeneratedItemOwnership.generatedItemEndIndexExclusive
Section titled “currentResponseGeneratedItemOwnership.generatedItemEndIndexExclusive”generatedItemEndIndexExclusive: number;currentResponseGeneratedItemOwnership.generatedItemStartIndex
Section titled “currentResponseGeneratedItemOwnership.generatedItemStartIndex”generatedItemStartIndex: number;currentResponseGeneratedItemOwnership.interruptionGeneratedItemIndexes
Section titled “currentResponseGeneratedItemOwnership.interruptionGeneratedItemIndexes”interruptionGeneratedItemIndexes: number[];currentResponseGeneratedItemOwnership.toolOutputGuardrailResultStartIndex
Section titled “currentResponseGeneratedItemOwnership.toolOutputGuardrailResultStartIndex”toolOutputGuardrailResultStartIndex: number;currentStep?
Section titled “currentStep?”optional currentStep?: | { newAgent: any; type: "next_step_handoff";} | { localFinalizationStarted?: true; output: string; responseAccepted?: true; type: "next_step_final_output";} | { type: "next_step_run_again";} | { data: Record<string, any>; type: "next_step_interruption";};currentTurn
Section titled “currentTurn”currentTurn: number;currentTurnBlockedSessionStartIndex?
Section titled “currentTurnBlockedSessionStartIndex?”optional currentTurnBlockedSessionStartIndex?: number;currentTurnDeferredSessionItemIndexes?
Section titled “currentTurnDeferredSessionItemIndexes?”optional currentTurnDeferredSessionItemIndexes?: number[];currentTurnExecutedWithSessionBinding?
Section titled “currentTurnExecutedWithSessionBinding?”optional currentTurnExecutedWithSessionBinding?: true;currentTurnInProgress?
Section titled “currentTurnInProgress?”optional currentTurnInProgress?: boolean;currentTurnPersistedItemCount?
Section titled “currentTurnPersistedItemCount?”optional currentTurnPersistedItemCount?: number;currentTurnSessionInputItems?
Section titled “currentTurnSessionInputItems?”optional currentTurnSessionInputItems?: ( | { content: ( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; promptCacheBreakpoint?: { mode: "explicit"; }; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message";} | { content: | string | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message";} | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message";} | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program";} | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output";} | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call";} | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call";} | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call";} | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<...>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<...>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result";} | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call";} | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result";} | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output";} | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning";} | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction";} | { id?: string; providerData?: Record<string, any>; type: "unknown";})[];currentTurnSessionWriteCompactedItemCount?
Section titled “currentTurnSessionWriteCompactedItemCount?”optional currentTurnSessionWriteCompactedItemCount?: number;generatedItems
Section titled “generatedItems”generatedItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: ( | { providerData?: Record<..., ...>; refusal: string; type: "refusal"; } | { providerData?: Record<..., ...>; text: string; type: "output_text"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<..., ...>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: | string | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; } | { audio: ... | ...; format?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; transcript?: ... | ... | ...; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: ... | ...; mediaType?: ... | ...; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: ... | ...; filename: string; mediaType: string; } | { filename?: ... | ...; url: string; } | { filename?: ... | ...; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; }; type: "input_item";} | { agent: { identity?: string; name: string; }; rawItem: { content: ( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; promptCacheBreakpoint?: { mode: "explicit"; }; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item";} | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item";} | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item";} | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; type: "tool_call_item";} | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: ... | ...; mediaType?: ... | ...; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: ... | ...; filename: string; mediaType: string; } | { filename?: ... | ...; url: string; } | { filename?: ... | ...; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; }; type: "tool_call_output_item";} | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; }; type: "reasoning_item";} | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; }; type: "compaction_item";} | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item";} | { rawItem: { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<...>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<...>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item";} | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item";})[];inputGuardrailResults
Section titled “inputGuardrailResults”inputGuardrailResults: object[];lastModelResponse?
Section titled “lastModelResponse?”optional lastModelResponse?: object;lastModelResponse.output
Section titled “lastModelResponse.output”output: ( | { content: ( | { providerData?: Record<..., ...>; refusal: string; type: "refusal"; } | { providerData?: Record<..., ...>; text: string; type: "output_text"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<..., ...>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message";} | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program";} | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output";} | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call";} | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call";} | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call";} | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: ... | ...; mediaType?: ... | ...; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: ... | ...; filename: string; mediaType: string; } | { filename?: ... | ...; url: string; } | { filename?: ... | ...; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result";} | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call";} | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output";} | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning";} | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction";} | { id?: string; providerData?: Record<string, any>; type: "unknown";})[];lastModelResponse.providerData?
Section titled “lastModelResponse.providerData?”optional providerData?: Record<string, any>;lastModelResponse.requestId?
Section titled “lastModelResponse.requestId?”optional requestId?: string;lastModelResponse.responseId?
Section titled “lastModelResponse.responseId?”optional responseId?: string;lastModelResponse.usage
Section titled “lastModelResponse.usage”usage: object = usageSchema;lastModelResponse.usage.inputTokens
Section titled “lastModelResponse.usage.inputTokens”inputTokens: number;lastModelResponse.usage.inputTokensDetails?
Section titled “lastModelResponse.usage.inputTokensDetails?”optional inputTokensDetails?: Record<string, number>[];lastModelResponse.usage.outputTokens
Section titled “lastModelResponse.usage.outputTokens”outputTokens: number;lastModelResponse.usage.outputTokensDetails?
Section titled “lastModelResponse.usage.outputTokensDetails?”optional outputTokensDetails?: Record<string, number>[];lastModelResponse.usage.requests
Section titled “lastModelResponse.usage.requests”requests: number;lastModelResponse.usage.requestUsageEntries?
Section titled “lastModelResponse.usage.requestUsageEntries?”optional requestUsageEntries?: object[];lastModelResponse.usage.totalTokens
Section titled “lastModelResponse.usage.totalTokens”totalTokens: number;lastProcessedResponse?
Section titled “lastProcessedResponse?”optional lastProcessedResponse?: object;lastProcessedResponse.applyPatchActions?
Section titled “lastProcessedResponse.applyPatchActions?”optional applyPatchActions?: object[];lastProcessedResponse.computerActions
Section titled “lastProcessedResponse.computerActions”computerActions: object[];lastProcessedResponse.functions
Section titled “lastProcessedResponse.functions”functions: object[];lastProcessedResponse.functionToolsNotFound?
Section titled “lastProcessedResponse.functionToolsNotFound?”optional functionToolsNotFound?: object[];lastProcessedResponse.handoffs
Section titled “lastProcessedResponse.handoffs”handoffs: object[];lastProcessedResponse.mcpApprovalRequests?
Section titled “lastProcessedResponse.mcpApprovalRequests?”optional mcpApprovalRequests?: object[];lastProcessedResponse.newItems
Section titled “lastProcessedResponse.newItems”newItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: ( | { providerData?: ...; refusal: ...; type: ...; } | { providerData?: ...; text: ...; type: ...; } | { audio: ...; format?: ...; promptCacheBreakpoint?: ...; providerData?: ...; transcript?: ...; type: ...; } | { image: ...; providerData?: ...; type: ...; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | (... | ... | ... | ...)[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; }; actions?: (... | ... | ... | ... | ... | ... | ... | ... | ...)[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<..., ...>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: ... | ...; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; }; type: "input_item";} | { agent: { identity?: string; name: string; }; rawItem: { content: ( | { providerData?: ... | ...; refusal: string; type: "refusal"; } | { providerData?: ... | ...; text: string; type: "output_text"; } | { audio: ... | ...; format?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; transcript?: ... | ... | ...; type: "audio"; } | { image: string; providerData?: ... | ...; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item";} | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item";} | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item";} | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; }; actions?: (... | ... | ... | ... | ... | ... | ... | ... | ...)[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: ... | ...; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; type: "tool_call_item";} | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ... | ...; text: string; type: "text"; } | { detail?: ... | ... | ... | ... | ...; image?: ... | ... | ... | ... | ...; providerData?: ... | ...; type: "image"; } | { file: ... | ... | ... | ...; providerData?: ... | ...; type: "file"; } | (... | ... | ...)[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<..., ...>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; }; type: "tool_call_output_item";} | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; }; type: "reasoning_item";} | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; }; type: "compaction_item";} | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item";} | { rawItem: { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<..., ...>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | ... & ...; image?: | string | { data: ...; mediaType?: ...; } | { url: ...; } | { fileId: ...; }; providerData?: Record<..., ...>; type: "image"; } | { file: | string | { data: ...; filename: ...; mediaType: ...; } | { filename?: ...; url: ...; } | { filename?: ...; id: ...; }; providerData?: Record<..., ...>; type: "file"; } | ( | { promptCacheBreakpoint?: ...; providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; promptCacheBreakpoint?: ...; providerData?: ...; type: ...; } | { file?: ...; filename?: ...; promptCacheBreakpoint?: ...; providerData?: ...; type: ...; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item";} | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { action?: | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; }; actions?: (... | ... | ... | ... | ... | ... | ... | ... | ...)[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: ... | ...; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item";})[];lastProcessedResponse.shellActions?
Section titled “lastProcessedResponse.shellActions?”optional shellActions?: object[];lastProcessedResponse.toolsUsed
Section titled “lastProcessedResponse.toolsUsed”toolsUsed: string[];maxTurns
Section titled “maxTurns”maxTurns: number | null;modelResponses
Section titled “modelResponses”modelResponses: object[];noActiveAgentRun
Section titled “noActiveAgentRun”noActiveAgentRun: boolean;originalInput
Section titled “originalInput”originalInput: | string | ( | { content: ( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; promptCacheBreakpoint?: { mode: "explicit"; }; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message";} | { content: | string | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message";} | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message";} | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program";} | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output";} | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call";} | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call";} | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call";} | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<...>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<...>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result";} | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call";} | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result";} | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output";} | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning";} | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction";} | { id?: string; providerData?: Record<string, any>; type: "unknown";})[];outputGuardrailResults
Section titled “outputGuardrailResults”outputGuardrailResults: object[];pendingAgentToolRunAliases
Section titled “pendingAgentToolRunAliases”pendingAgentToolRunAliases: Record<string, string>;pendingAgentToolRuns
Section titled “pendingAgentToolRuns”pendingAgentToolRuns: Record<string, string>;pendingInput?
Section titled “pendingInput?”optional pendingInput?: ( | { content: ( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; promptCacheBreakpoint?: { mode: "explicit"; }; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message";} | { content: | string | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message";} | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message";} | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program";} | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output";} | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call";} | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call";} | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call";} | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<...>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<...>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result";} | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call";} | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result";} | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output";} | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning";} | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction";} | { id?: string; providerData?: Record<string, any>; type: "unknown";})[];pendingLegacyCompactionSessionItems?
Section titled “pendingLegacyCompactionSessionItems?”optional pendingLegacyCompactionSessionItems?: ( | { content: ( | { providerData?: Record<string, any>; refusal: string; type: "refusal"; } | { providerData?: Record<string, any>; text: string; type: "output_text"; } | { audio: | string | { id: string; }; format?: string | null; promptCacheBreakpoint?: { mode: "explicit"; }; providerData?: Record<string, any>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<string, any>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message";} | { content: | string | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message";} | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message";} | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program";} | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output";} | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call";} | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call";} | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call";} | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: string | Uint8Array<...>; mediaType?: string; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: string | Uint8Array<...>; filename: string; mediaType: string; } | { filename?: string; url: string; } | { filename?: string; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; text: string; type: "input_text"; } | { detail?: string; image?: | string | { id: ...; }; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_image"; } | { file?: | string | { id: ...; } | { url: ...; }; filename?: string; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result";} | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call";} | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result";} | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call";} | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output";} | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning";} | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction";} | { id?: string; providerData?: Record<string, any>; type: "unknown";})[];pendingSessionHistoryTransaction?
Section titled “pendingSessionHistoryTransaction?”optional pendingSessionHistoryTransaction?: object;pendingSessionHistoryTransaction.alreadyPersistedCount
Section titled “pendingSessionHistoryTransaction.alreadyPersistedCount”alreadyPersistedCount: number;pendingSessionHistoryTransaction.deferredItemIndexes
Section titled “pendingSessionHistoryTransaction.deferredItemIndexes”deferredItemIndexes: number[];pendingSessionHistoryTransaction.operationId
Section titled “pendingSessionHistoryTransaction.operationId”operationId: string;pendingSessionHistoryTransaction.persistedItemCount
Section titled “pendingSessionHistoryTransaction.persistedItemCount”persistedItemCount: number;pendingSessionHistoryTransaction.replaceRunItemIndexes
Section titled “pendingSessionHistoryTransaction.replaceRunItemIndexes”replaceRunItemIndexes: number[];pendingSessionHistoryTransaction.runItemIndexes
Section titled “pendingSessionHistoryTransaction.runItemIndexes”runItemIndexes: number[];pendingSessionHistoryTransaction.transactionKind
Section titled “pendingSessionHistoryTransaction.transactionKind”transactionKind: "blocked_append" | "accepted_replace";pendingSessionWrite?
Section titled “pendingSessionWrite?”optional pendingSessionWrite?: | { alreadyPersistedCount: number; handoffInput?: { generatedItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: ...[]; id?: ... | ...; phase?: ... | ... | ...; providerData?: ... | ...; role: "assistant"; status: ... | ... | ...; type?: ... | ...; } | { content: ... | ...; id?: ... | ...; providerData?: ... | ...; role: "user"; type?: ... | ...; } | { content: string; id?: ... | ...; providerData?: ... | ...; role: "system"; type?: ... | ...; } | { callId: string; code: string; fingerprint: string; id?: ... | ...; providerData?: ... | ...; type: "program"; } | { callId: string; id?: ... | ...; output: string; providerData?: ... | ...; status: ... | ...; type: "program_output"; } | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { arguments: unknown; call_id?: ... | ... | ...; callId?: ... | ... | ...; execution?: ... | ... | ...; id?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "tool_search_call"; } | { call_id?: ... | ... | ...; callId?: ... | ... | ...; execution?: ... | ... | ...; id?: ... | ...; providerData?: ... | ...; status?: ... | ...; tools: ...[]; toolSearchAgentName?: ... | ...; type: "tool_search_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; output: ... | ... | ... | ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "function_call_result"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { callId: string; id?: ... | ...; output: { data: ...; providerData?: ...; type: ...; }; providerData?: ... | ...; type: "computer_call_result"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; maxOutputLength?: ... | ...; output: ...[]; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; output?: ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call_output"; } | { content: ...[]; id?: ... | ...; providerData?: ... | ...; rawContent?: ... | ...; type: "reasoning"; } | { created_by?: ... | ...; encrypted_content: string; id?: ... | ...; providerData?: ... | ...; type: "compaction"; } | { id?: ... | ...; providerData?: ... | ...; type: "unknown"; }; type: "input_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item"; } | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: ... | ...; providerData?: ... | ...; type: "program"; } | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; }; type: "tool_call_item"; } | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: ... | ...; output: string; providerData?: ... | ...; status: ... | ...; type: "program_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; output: ... | ... | ... | ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "function_call_result"; } | { callId: string; id?: ... | ...; output: { data: ...; providerData?: ...; type: ...; }; providerData?: ... | ...; type: "computer_call_result"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; maxOutputLength?: ... | ...; output: ...[]; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; output?: ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call_output"; }; type: "tool_call_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; }; type: "reasoning_item"; } | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; }; type: "compaction_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item"; } | { rawItem: { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item"; })[]; originalInput: | string | ( | { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | ...[]; id?: string; providerData?: Record<..., ...>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<..., ...>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; } | { id?: string; providerData?: Record<..., ...>; type: "unknown"; })[]; }; persistedItemCount: number; phase: "prepared"; reasoningItemIdPolicy: "omit" | "preserve"; sessionId: string; terminalToolFinalization?: { behavior: "function" | "stop_on_first_tool" | "stop_at_tool_names"; finalOutput: string; selectedCallId?: string; selectedGeneratedItemIndex?: number; };} | { alreadyPersistedCount: number; beforeItems: ( | { content: ( | { providerData?: Record<..., ...>; refusal: string; type: "refusal"; } | { providerData?: Record<..., ...>; text: string; type: "output_text"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<..., ...>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: | string | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; } | { audio: ... | ...; format?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; transcript?: ... | ... | ...; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: ... | ...; mediaType?: ... | ...; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: ... | ...; filename: string; mediaType: string; } | { filename?: ... | ...; url: string; } | { filename?: ... | ...; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; })[]; comparableAppendItems: ( | { content: ( | { providerData?: Record<..., ...>; refusal: string; type: "refusal"; } | { providerData?: Record<..., ...>; text: string; type: "output_text"; } | { audio: | string | { id: ...; }; format?: string | null; promptCacheBreakpoint?: { mode: ...; }; providerData?: Record<..., ...>; transcript?: string | null; type: "audio"; } | { image: string; providerData?: Record<..., ...>; type: "image"; })[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<string, any>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: | string | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; } | { audio: ... | ...; format?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; transcript?: ... | ... | ...; type: "audio"; })[]; id?: string; providerData?: Record<string, any>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<string, any>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<string, any>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<string, any>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; id?: string; name: string; output?: string; providerData?: Record<string, any>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<string, any>; status?: string; tools: Record<string, any>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: Record<string, any>; text: string; type: "text"; } | { detail?: "low" | "high" | "auto" | string & object; image?: | string | { data: ... | ...; mediaType?: ... | ...; } | { url: string; } | { fileId: string; }; providerData?: Record<string, any>; type: "image"; } | { file: | string | { data: ... | ...; filename: string; mediaType: string; } | { filename?: ... | ...; url: string; } | { filename?: ... | ...; id: string; }; providerData?: Record<string, any>; type: "file"; } | ( | { promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; text: string; type: "input_text"; } | { detail?: ... | ...; image?: ... | ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_image"; } | { file?: ... | ... | ... | ...; filename?: ... | ...; promptCacheBreakpoint?: ... | ...; providerData?: ... | ...; type: "input_file"; })[]; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: "screenshot"; } | { button: "left" | "right" | "wheel" | "back" | "forward"; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: string[]; type: "keypress"; } | { path: object[]; type: "drag"; }; actions?: ( | { type: "screenshot"; } | { button: ... | ... | ... | ... | ...; type: "click"; x: number; y: number; } | { type: "double_click"; x: number; y: number; } | { scroll_x: number; scroll_y: number; type: "scroll"; x: number; y: number; } | { text: string; type: "type"; } | { type: "wait"; } | { type: "move"; x: number; y: number; } | { keys: ...[]; type: "keypress"; } | { path: ...[]; type: "drag"; })[]; callId: string; id?: string; providerData?: Record<string, any>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: Record<string, any>; type: "computer_screenshot"; }; providerData?: Record<string, any>; type: "computer_call_result"; } | { action: { commands: string[]; maxOutputLength?: number; timeoutMs?: number; }; caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<string, any>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; operation: | { diff: string; path: string; type: "create_file"; } | { diff: string; moveTo?: string; path: string; type: "update_file"; } | { path: string; type: "delete_file"; }; providerData?: Record<string, any>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: "direct"; } | { callerId: string; type: "program"; }; callId: string; id?: string; output?: string; providerData?: Record<string, any>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<string, any>; rawContent?: object[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<string, any>; type: "compaction"; } | { id?: string; providerData?: Record<string, any>; type: "unknown"; })[]; handoffInput?: { generatedItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: ...[]; id?: ... | ...; phase?: ... | ... | ...; providerData?: ... | ...; role: "assistant"; status: ... | ... | ...; type?: ... | ...; } | { content: ... | ...; id?: ... | ...; providerData?: ... | ...; role: "user"; type?: ... | ...; } | { content: string; id?: ... | ...; providerData?: ... | ...; role: "system"; type?: ... | ...; } | { callId: string; code: string; fingerprint: string; id?: ... | ...; providerData?: ... | ...; type: "program"; } | { callId: string; id?: ... | ...; output: string; providerData?: ... | ...; status: ... | ...; type: "program_output"; } | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { arguments: unknown; call_id?: ... | ... | ...; callId?: ... | ... | ...; execution?: ... | ... | ...; id?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "tool_search_call"; } | { call_id?: ... | ... | ...; callId?: ... | ... | ...; execution?: ... | ... | ...; id?: ... | ...; providerData?: ... | ...; status?: ... | ...; tools: ...[]; toolSearchAgentName?: ... | ...; type: "tool_search_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; output: ... | ... | ... | ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "function_call_result"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { callId: string; id?: ... | ...; output: { data: ...; providerData?: ...; type: ...; }; providerData?: ... | ...; type: "computer_call_result"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; maxOutputLength?: ... | ...; output: ...[]; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; output?: ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call_output"; } | { content: ...[]; id?: ... | ...; providerData?: ... | ...; rawContent?: ... | ...; type: "reasoning"; } | { created_by?: ... | ...; encrypted_content: string; id?: ... | ...; providerData?: ... | ...; type: "compaction"; } | { id?: ... | ...; providerData?: ... | ...; type: "unknown"; }; type: "input_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item"; } | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: ... | ...; providerData?: ... | ...; type: "program"; } | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; }; type: "tool_call_item"; } | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: ... | ...; output: string; providerData?: ... | ...; status: ... | ...; type: "program_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; output: ... | ... | ... | ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "function_call_result"; } | { callId: string; id?: ... | ...; output: { data: ...; providerData?: ...; type: ...; }; providerData?: ... | ...; type: "computer_call_result"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; maxOutputLength?: ... | ...; output: ...[]; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; output?: ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call_output"; }; type: "tool_call_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; }; type: "reasoning_item"; } | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; }; type: "compaction_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item"; } | { rawItem: { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item"; })[]; originalInput: | string | ( | { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | ...[]; id?: string; providerData?: Record<..., ...>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<..., ...>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; } | { id?: string; providerData?: Record<..., ...>; type: "unknown"; })[]; }; persistedItemCount: number; phase: "append_ready"; reasoningItemIdPolicy: "omit" | "preserve"; sessionId: string; terminalToolFinalization?: { behavior: "function" | "stop_on_first_tool" | "stop_at_tool_names"; finalOutput: string; selectedCallId?: string; selectedGeneratedItemIndex?: number; };} | { alreadyPersistedCount: number; handoffInput?: { generatedItems: ( | { agent: { identity?: string; name: string; }; inputId: string; rawItem: | { content: ...[]; id?: ... | ...; phase?: ... | ... | ...; providerData?: ... | ...; role: "assistant"; status: ... | ... | ...; type?: ... | ...; } | { content: ... | ...; id?: ... | ...; providerData?: ... | ...; role: "user"; type?: ... | ...; } | { content: string; id?: ... | ...; providerData?: ... | ...; role: "system"; type?: ... | ...; } | { callId: string; code: string; fingerprint: string; id?: ... | ...; providerData?: ... | ...; type: "program"; } | { callId: string; id?: ... | ...; output: string; providerData?: ... | ...; status: ... | ...; type: "program_output"; } | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { arguments: unknown; call_id?: ... | ... | ...; callId?: ... | ... | ...; execution?: ... | ... | ...; id?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "tool_search_call"; } | { call_id?: ... | ... | ...; callId?: ... | ... | ...; execution?: ... | ... | ...; id?: ... | ...; providerData?: ... | ...; status?: ... | ...; tools: ...[]; toolSearchAgentName?: ... | ...; type: "tool_search_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; output: ... | ... | ... | ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "function_call_result"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { callId: string; id?: ... | ...; output: { data: ...; providerData?: ...; type: ...; }; providerData?: ... | ...; type: "computer_call_result"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; maxOutputLength?: ... | ...; output: ...[]; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; output?: ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call_output"; } | { content: ...[]; id?: ... | ...; providerData?: ... | ...; rawContent?: ... | ...; type: "reasoning"; } | { created_by?: ... | ...; encrypted_content: string; id?: ... | ...; providerData?: ... | ...; type: "compaction"; } | { id?: ... | ...; providerData?: ... | ...; type: "unknown"; }; type: "input_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; }; type: "message_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; }; type: "tool_search_call_item"; } | { agent: { identity?: string; name: string; }; rawItem: { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; }; type: "tool_search_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { callId: string; code: string; fingerprint: string; id?: ... | ...; providerData?: ... | ...; type: "program"; } | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; }; type: "tool_call_item"; } | { agent: { identity?: string; name: string; }; customData?: Record<string, any>; executionStatus?: "executed"; output: JsonCompatibleValue; rawItem: | { callId: string; id?: ... | ...; output: string; providerData?: ... | ...; status: ... | ...; type: "program_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; output: ... | ... | ... | ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "function_call_result"; } | { callId: string; id?: ... | ...; output: { data: ...; providerData?: ...; type: ...; }; providerData?: ... | ...; type: "computer_call_result"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; maxOutputLength?: ... | ...; output: ...[]; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call_output"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; output?: ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call_output"; }; type: "tool_call_output_item"; } | { agent: { identity?: string; name: string; }; rawItem: { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; }; type: "reasoning_item"; } | { agent: { identity?: string; name: string; }; rawItem: { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; }; type: "compaction_item"; } | { agent: { identity?: string; name: string; }; rawItem: { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; }; type: "handoff_call_item"; } | { rawItem: { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; }; sourceAgent: { identity?: string; name: string; }; targetAgent: { identity?: string; name: string; }; type: "handoff_output_item"; } | { agent: { identity?: string; name: string; }; functionToolStateKey?: string; rawItem: | { arguments?: ... | ...; caller?: ... | ... | ...; id?: ... | ...; name: string; output?: ... | ...; providerData?: ... | ...; status?: ... | ...; type: "hosted_tool_call"; } | { arguments: string; caller?: ... | ... | ...; callId: string; id?: ... | ...; name: string; namespace?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "function_call"; } | { action?: ... | ... | ... | ... | ... | ... | ... | ... | ... | ...; actions?: ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status: ... | ... | ...; type: "computer_call"; } | { action: { commands: ...; maxOutputLength?: ...; timeoutMs?: ...; }; caller?: ... | ... | ...; callId: string; id?: ... | ...; providerData?: ... | ...; status?: ... | ... | ... | ...; type: "shell_call"; } | { caller?: ... | ... | ...; callId: string; id?: ... | ...; operation: ... | ... | ...; providerData?: ... | ...; status: ... | ...; type: "apply_patch_call"; }; toolName?: string; type: "tool_approval_item"; })[]; originalInput: | string | ( | { content: (... | ... | ... | ...)[]; id?: string; phase?: "commentary" | "final_answer"; providerData?: Record<..., ...>; role: "assistant"; status: "in_progress" | "completed" | "incomplete"; type?: "message"; } | { content: string | ...[]; id?: string; providerData?: Record<..., ...>; role: "user"; type?: "message"; } | { content: string; id?: string; providerData?: Record<..., ...>; role: "system"; type?: "message"; } | { callId: string; code: string; fingerprint: string; id?: string; providerData?: Record<..., ...>; type: "program"; } | { callId: string; id?: string; output: string; providerData?: Record<..., ...>; status: "completed" | "incomplete"; type: "program_output"; } | { arguments?: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; id?: string; name: string; output?: string; providerData?: Record<..., ...>; status?: string; type: "hosted_tool_call"; } | { arguments: string; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "function_call"; } | { arguments: unknown; call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; type: "tool_search_call"; } | { call_id?: string | null; callId?: string | null; execution?: "client" | "server"; id?: string; providerData?: Record<..., ...>; status?: string; tools: Record<..., ...>[]; toolSearchAgentName?: string; type: "tool_search_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; name: string; namespace?: string; output: | string | { providerData?: ...; text: ...; type: ...; } | { detail?: ...; image?: ...; providerData?: ...; type: ...; } | { file: ...; providerData?: ...; type: ...; } | ...[]; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "function_call_result"; } | { action?: | { type: ...; } | { button: ...; type: ...; x: ...; y: ...; } | { type: ...; x: ...; y: ...; } | { scroll_x: ...; scroll_y: ...; type: ...; x: ...; y: ...; } | { text: ...; type: ...; } | { type: ...; } | { type: ...; x: ...; y: ...; } | { keys: ...; type: ...; } | { path: ...; type: ...; }; actions?: ...[]; callId: string; id?: string; providerData?: Record<..., ...>; status: "in_progress" | "completed" | "incomplete"; type: "computer_call"; } | { callId: string; id?: string; output: { data: string; providerData?: ... | ...; type: "computer_screenshot"; }; providerData?: Record<..., ...>; type: "computer_call_result"; } | { action: { commands: ...[]; maxOutputLength?: ... | ...; timeoutMs?: ... | ...; }; caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; maxOutputLength?: number; output: object[]; providerData?: Record<..., ...>; status?: "in_progress" | "completed" | "incomplete"; type: "shell_call_output"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; operation: | { diff: ...; path: ...; type: ...; } | { diff: ...; moveTo?: ...; path: ...; type: ...; } | { path: ...; type: ...; }; providerData?: Record<..., ...>; status: "in_progress" | "completed"; type: "apply_patch_call"; } | { caller?: | { type: ...; } | { callerId: ...; type: ...; }; callId: string; id?: string; output?: string; providerData?: Record<..., ...>; status: "completed" | "failed"; type: "apply_patch_call_output"; } | { content: object[]; id?: string; providerData?: Record<..., ...>; rawContent?: ...[]; type: "reasoning"; } | { created_by?: string; encrypted_content: string; id?: string; providerData?: Record<..., ...>; type: "compaction"; } | { id?: string; providerData?: Record<..., ...>; type: "unknown"; })[]; }; persistedItemCount: number; phase: "compaction_pending"; reasoningItemIdPolicy: "omit" | "preserve"; sessionId: string; terminalToolFinalization?: { behavior: "function" | "stop_on_first_tool" | "stop_at_tool_names"; finalOutput: string; selectedCallId?: string; selectedGeneratedItemIndex?: number; };};previousResponseId?
Section titled “previousResponseId?”optional previousResponseId?: string;reasoningItemIdPolicy?
Section titled “reasoningItemIdPolicy?”optional reasoningItemIdPolicy?: "omit" | "preserve";sandbox?
Section titled “sandbox?”optional sandbox?: object;sandbox.backendId
Section titled “sandbox.backendId”backendId: string;sandbox.currentAgentKey
Section titled “sandbox.currentAgentKey”currentAgentKey: string;sandbox.currentAgentName
Section titled “sandbox.currentAgentName”currentAgentName: string;sandbox.sessionsByAgent
Section titled “sandbox.sessionsByAgent”sessionsByAgent: Record<string, { backendId: string; currentAgentKey: string; currentAgentName: string; preservedOwnedSession?: boolean; requiresFreshCreation?: boolean; reuseLiveSession?: boolean; sessionState: { backendId: string; exposedPorts?: Record<string, any>; manifest: Record<string, any>; providerState: Record<string, any>; snapshot?: Record<string, any> | null; snapshotFingerprint?: string | null; snapshotFingerprintVersion?: string | null; version: 1 | 2 | 3 | 4 | 5; workspaceReady: boolean; };}>;sandbox.sessionState
Section titled “sandbox.sessionState”sessionState: object = sandboxSessionStateEnvelopeSchema;sandbox.sessionState.backendId
Section titled “sandbox.sessionState.backendId”backendId: string;sandbox.sessionState.exposedPorts?
Section titled “sandbox.sessionState.exposedPorts?”optional exposedPorts?: Record<string, any>;sandbox.sessionState.manifest
Section titled “sandbox.sessionState.manifest”manifest: Record<string, any>;sandbox.sessionState.providerState
Section titled “sandbox.sessionState.providerState”providerState: Record<string, any>;sandbox.sessionState.snapshot?
Section titled “sandbox.sessionState.snapshot?”optional snapshot?: Record<string, any> | null;sandbox.sessionState.snapshotFingerprint?
Section titled “sandbox.sessionState.snapshotFingerprint?”optional snapshotFingerprint?: string | null;sandbox.sessionState.snapshotFingerprintVersion?
Section titled “sandbox.sessionState.snapshotFingerprintVersion?”optional snapshotFingerprintVersion?: string | null;sandbox.sessionState.version
Section titled “sandbox.sessionState.version”version: 1 | 2 | 3 | 4 | 5;sandbox.sessionState.workspaceReady
Section titled “sandbox.sessionState.workspaceReady”workspaceReady: boolean;toolInputGuardrailResults
Section titled “toolInputGuardrailResults”toolInputGuardrailResults: object[];toolOutputGuardrailResults
Section titled “toolOutputGuardrailResults”toolOutputGuardrailResults: object[];toolUseTracker
Section titled “toolUseTracker”toolUseTracker: Record<string, string[]>;trace: | { group_id: string | null; id: string; metadata: Record<string, any>; object: "trace"; tracing_api_key?: string | null; workflow_name: string;} | null;toString()
Section titled “toString()”toString(options?): string;Serializes the run state to a string.
This method is used to serialize the run state to a string that can be used to resume the run later.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
{ |
|
|
|
Returns
Section titled “Returns”string
The serialized run state.
fromString()
Section titled “fromString()”static fromString<TContext, TAgent>(initialAgent, str): Promise<RunState<TContext, TAgent>>;Deserializes a run state from a string.
This method is used to deserialize a run state from a string that was serialized using the
toString method.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
|
|
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
Returns
Section titled “Returns”Promise<RunState<TContext, TAgent>>
fromStringWithContext()
Section titled “fromStringWithContext()”static fromStringWithContext<TContext, TAgent>( initialAgent, str, context,options?): Promise<RunState<TContext, TAgent>>;Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
|
|
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
Returns
Section titled “Returns”Promise<RunState<TContext, TAgent>>