Expand description
Defines the protocol for a Codex session between a client and an agent.
Uses a SQ (Submission Queue) / EQ (Event Queue) pattern to asynchronously communicate between user and agent.
Structs§
- Agent
Message Delta Event - Agent
Message Event - Agent
Reasoning Delta Event - Agent
Reasoning Event - Agent
Reasoning RawContent Delta Event - Agent
Reasoning RawContent Event - Agent
Reasoning Section Break Event - Apply
Patch Approval Request Event - Background
Event Event - Browser
Snapshot Event - Chunk
- Compacted
Item - Compaction
Checkpoint Warning Event - Conversation
Path Response Event - Response payload for
Op::GetHistorycontaining the current session’s in-memory transcript. - Environment
Context Delta Event - Environment
Context Full Event - Error
Event - Event
- Event Queue Entry - events from agent
- Exec
Approval Request Event - Exec
Command Begin Event - Exec
Command EndEvent - Exec
Command Output Delta Event - Exited
Review Mode Event - Final
Output - GetHistory
Entry Response Event - GitInfo
- List
Custom Prompts Response Event - Response payload for
Op::ListCustomPrompts. - List
Skills Response Event - Response payload for
Op::ListSkills. - McpInvocation
- McpList
Tools Response Event - Response payload for
Op::ListMcpTools. - McpTool
Call Begin Event - McpTool
Call EndEvent - Order
Meta - Patch
Apply Begin Event - Patch
Apply EndEvent - Rate
Limit Snapshot - Rate
Limit Window - Recorded
Event - Lightweight representation of an event suitable for persistence and replay.
- Replay
History Event - Payload for
ReplayHistorycontaining priorResponseItems. - Resumed
History - Review
Code Location - Location of the code related to a review finding.
- Review
Context Metadata - Review
Finding - A single review finding describing an observed issue or recommendation.
- Review
Line Range - Inclusive line range in a file associated with the finding.
- Review
Output Event - Structured review result produced by a child review session.
- Review
Request - Review request sent to the review session.
- Review
Snapshot Info - Git/worktree context captured at review time.
- Rollout
Line - Session
Configured Event - Session
Meta - Session
Meta Line - Stream
Error Event - Submission
- Submission Queue Entry - requests from user
- Task
Complete Event - Task
Started Event - Token
Count Event - Token
Usage - Token
Usage Info - Turn
Aborted Event - Turn
Context Item - Turn
Diff Event - User
Message Event - View
Image Tool Call Event - WebSearch
Begin Event - WebSearch
EndEvent - Writable
Root - A writable root path accompanied by a list of subpaths that should remain
read‑only even when the root is writable. This is primarily used to ensure
top‑level VCS metadata directories (e.g.
.git) under a writable root are not modified by the agent.
Enums§
- Approved
Command Match Kind - AskFor
Approval - Determines the conditions under which the user is consulted to approve running the command proposed by Codex.
- Codex
Error Info - Codex errors that we expose to clients.
- Event
Msg - Response event from the agent NOTE: Make sure none of these values have optional types, as it will mess up the extension code-gen.
- Exec
Output Stream - File
Change - Initial
History - Input
Item - User input
- Input
Message Kind - Op
- Submission operation
- Review
Decision - User’s decision in response to an ExecApprovalRequest.
- Rollout
Item - Sandbox
Policy - Determines execution restrictions for model shell commands.
- Session
Source - Truncation
Policy - Turn
Abort Reason
Constants§
- BROWSER_
SNAPSHOT_ CLOSE_ TAG - BROWSER_
SNAPSHOT_ OPEN_ TAG - ENVIRONMENT_
CONTEXT_ CLOSE_ TAG - ENVIRONMENT_
CONTEXT_ DELTA_ CLOSE_ TAG - ENVIRONMENT_
CONTEXT_ DELTA_ OPEN_ TAG - ENVIRONMENT_
CONTEXT_ OPEN_ TAG - USER_
INSTRUCTIONS_ CLOSE_ TAG - USER_
INSTRUCTIONS_ OPEN_ TAG - Open/close tags for special user-input blocks. Used across crates to avoid duplicated hardcoded strings.
- USER_
MESSAGE_ BEGIN