Item Lifecycle
All items follow a consistent lifecycle:1
item/started
Emits the full
item when a new unit of work begins2
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
3
item/completed
Sends the final
item once work finishesItem Types
userMessage
User text or image input.string
required
Item identifier
UserInput[]
required
Array of user input items (text, image, localImage, skill, mention)
agentMessage
Agent response text.string
required
Item identifier
string
required
Accumulated agent reply text
MessagePhase
Message phase (when applicable)
delta values for the same itemId to reconstruct the full reply.
plan
EXPERIMENTAL - Proposed plan item content.string
required
Item identifier
string
required
Plan text
The completed plan item is authoritative and may not match the concatenation of
PlanDelta text.reasoning
Agent reasoning traces.string
required
Item identifier
string[]
required
Streamed reasoning summaries (applicable for most OpenAI models)
string[]
required
Raw reasoning blocks (applicable for open source models)
commandExecution
Sandboxed shell command.string
required
Item identifier
string
required
The command to execute
string
required
Command working directory
string
PTY process identifier (when available)
CommandExecutionStatus
required
inProgress, completed, failed, or declinedCommandAction[]
required
Best-effort parsing of command actions
string
Combined stdout/stderr output
number
Command exit code
number
Execution duration in milliseconds
fileChange
Proposed or applied file edits.string
required
Item identifier
FileUpdateChange[]
required
Array of file changes with path, kind, and diff
PatchApplyStatus
required
inProgress, completed, failed, or declinedmcpToolCall
MCP (Model Context Protocol) tool invocation.string
required
Item identifier
string
required
MCP server name
string
required
Tool name
string
required
inProgress, completed, or failedobject
required
Tool arguments (JSON)
object
Tool result (when completed)
object
Error details (when failed)
number
Call duration in milliseconds
dynamicToolCall
Dynamic tool call executed on the client.string
required
Item identifier
string
required
Tool name
object
required
Tool arguments (JSON)
string
required
inProgress, completed, or failedobject[]
Output content items (text/images)
boolean
Whether the tool call succeeded
number
Call duration in milliseconds
webSearch
Web search request issued by the agent.string
required
Item identifier
string
required
Search query
WebSearchAction
Action payload (search, open_page, find_in_page)
imageView
Image viewer tool invocation.string
required
Item identifier
string
required
Path to the image file
enteredReviewMode
Emitted when the reviewer starts.string
required
Item identifier
string
required
Short user-facing label (e.g.,
"current changes", "commit abc123")exitedReviewMode
Emitted when the reviewer finishes.string
required
Item identifier
string
required
Full plain-text review (overall notes plus bullet point findings)
contextCompaction
Emitted when Codex compacts conversation history.string
required
Item identifier
Context compaction can happen automatically when the conversation history grows too large.
Item Notifications Summary
notification
Emits the full
item when work beginsnotification
Sends the final
item once work finishesnotification
Streams agent message text
notification
Streams plan content (experimental)
notification
Streams reasoning summary text
notification
Marks reasoning summary section boundaries
notification
Streams raw reasoning text (open source models)
notification
Streams command stdout/stderr
notification
Streams file change tool output
notification
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:1
item/started
Shows pending
commandExecution item2
item/commandExecution/requestApproval (server request)
3
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
4
serverRequest/resolved
Confirms the request was resolved
5
item/completed
Final item with execution result
File Change Approval
Order of messages:1
item/started
Emits
fileChange item with diff summaries2
item/fileChange/requestApproval (server request)
3
Client response
accept- Approve the changesdecline- Deny the changes
4
serverRequest/resolved
Confirms the request was resolved
5
item/completed
Final item with
status: "completed", "failed", or "declined"Next Steps
Models
List available models and capabilities
Skills
Manage and invoke skills