Item Lifecycle
All items follow a consistent lifecycle:Item-specific deltas (optional)
Zero or more streaming updates
item/agentMessage/delta- Agent text streamingitem/commandExecution/outputDelta- Command output streamingitem/reasoning/summaryTextDelta- Reasoning summary streaming
Item Types
userMessage
User text or image input.Item identifier
Array of user input items (text, image, localImage, skill, mention)
agentMessage
Agent response text.Item identifier
Accumulated agent reply text
Message phase (when applicable)
delta values for the same itemId to reconstruct the full reply.
plan
EXPERIMENTAL - Proposed plan item content.Item identifier
Plan text
The completed plan item is authoritative and may not match the concatenation of
PlanDelta text.reasoning
Agent reasoning traces.Item identifier
Streamed reasoning summaries (applicable for most OpenAI models)
Raw reasoning blocks (applicable for open source models)
commandExecution
Sandboxed shell command.Item identifier
The command to execute
Command working directory
PTY process identifier (when available)
inProgress, completed, failed, or declinedBest-effort parsing of command actions
Combined stdout/stderr output
Command exit code
Execution duration in milliseconds
fileChange
Proposed or applied file edits.Item identifier
Array of file changes with path, kind, and diff
inProgress, completed, failed, or declinedmcpToolCall
MCP (Model Context Protocol) tool invocation.Item identifier
MCP server name
Tool name
inProgress, completed, or failedTool arguments (JSON)
Tool result (when completed)
Error details (when failed)
Call duration in milliseconds
dynamicToolCall
Dynamic tool call executed on the client.Item identifier
Tool name
Tool arguments (JSON)
inProgress, completed, or failedOutput content items (text/images)
Whether the tool call succeeded
Call duration in milliseconds
webSearch
Web search request issued by the agent.Item identifier
Search query
Action payload (search, open_page, find_in_page)
imageView
Image viewer tool invocation.Item identifier
Path to the image file
enteredReviewMode
Emitted when the reviewer starts.Item identifier
Short user-facing label (e.g.,
"current changes", "commit abc123")exitedReviewMode
Emitted when the reviewer finishes.Item identifier
Full plain-text review (overall notes plus bullet point findings)
contextCompaction
Emitted when Codex compacts conversation history.Item identifier
Context compaction can happen automatically when the conversation history grows too large.
Item Notifications Summary
Emits the full
item when work beginsSends the final
item once work finishesStreams agent message text
Streams plan content (experimental)
Streams reasoning summary text
Marks reasoning summary section boundaries
Streams raw reasoning text (open source models)
Streams command stdout/stderr
Streams file change tool output
MCP tool call progress updates
Approvals
Certain actions (shell commands or file changes) may require explicit user approval depending on the approval policy.Command Execution Approval
Order of messages:Client response
accept- Approve the commandacceptForSession- Approve and cache for sessionacceptWithExecpolicyAmendment- Approve with persistent ruleapplyNetworkPolicyAmendment- Apply network policy ruledecline- Deny the commandcancel- Deny and interrupt turn
File Change Approval
Order of messages:Next Steps
Models
List available models and capabilities
Skills
Manage and invoke skills