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.
Re-exports§
pub use crate::approvals::ApplyPatchApprovalRequestEvent;pub use crate::approvals::ElicitationAction;pub use crate::approvals::ExecApprovalRequestEvent;pub use crate::approvals::ExecPolicyAmendment;pub use crate::approvals::NetworkApprovalContext;pub use crate::approvals::NetworkApprovalProtocol;pub use crate::mcp_protocol::InputItem;pub use crate::request_user_input::RequestUserInputEvent;
Structs§
- Agent
Message Content Delta Event - 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 - Auto
Context Check Event - Background
Event Event - Chunk
- Collab
Agent Interaction Begin Event - Collab
Agent Interaction EndEvent - Collab
Agent Spawn Begin Event - Collab
Agent Spawn EndEvent - Collab
Close Begin Event - Collab
Close EndEvent - Collab
Resume Begin Event - Collab
Resume EndEvent - Collab
Waiting Begin Event - Collab
Waiting EndEvent - Compacted
Item - Compaction
Checkpoint Warning Event - Context
Compacted Event - Conversation
Path Response Event - Response payload for
Op::GetHistorycontaining the current session’s in-memory transcript. - Credits
Snapshot - Deprecation
Notice Event - Error
Event - Event
- Event Queue Entry - events from agent
- Exec
Command Begin Event - Exec
Command EndEvent - Exec
Command Output Delta Event - Exited
Review Mode Event - Final
Output - GetHistory
Entry Response Event - GitInfo
- Item
Completed Event - Item
Started Event - List
Custom Prompts Response Event - Response payload for
Op::ListCustomPrompts. - List
Remote Skills Response Event - Response payload for
Op::ListRemoteSkills. - List
Skills Response Event - Response payload for
Op::ListSkills. - McpInvocation
- McpList
Tools Response Event - McpServer
Failure - McpServer
Refresh Config - Config payload for refreshing MCP servers.
- McpStartup
Complete Event - McpStartup
Failure - McpStartup
Update Event - McpTool
Call Begin Event - McpTool
Call EndEvent - Order
Meta - Patch
Apply Begin Event - Patch
Apply EndEvent - Plan
Delta Event - Rate
Limit Snapshot - Rate
Limit Window - RawResponse
Item Event - Reasoning
Content Delta Event - Reasoning
RawContent Delta Event - Recorded
Event - Reject
Config - Remote
Skill Downloaded Event - Response payload for
Op::DownloadRemoteSkill. - Remote
Skill Summary - 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 - Rollout
Line - Session
Configured Event - Session
Meta - SessionMeta contains session-level data that doesn’t correspond to a specific turn.
- Session
Meta Line - Skill
Dependencies - Skill
Error Info - Skill
Interface - Skill
Metadata - Skill
Tool Dependency - Skills
List Entry - Stream
Error Event - Stream
Info Event - Submission
- Submission Queue Entry - requests from user
- Terminal
Interaction Event - Thread
Name Updated Event - Thread
Rolled Back Event - Token
Count Event - Token
Usage - Token
Usage Info - Turn
Aborted Event - Turn
Complete Event - Turn
Context Item - Turn
Diff Event - Turn
Started Event - Undo
Completed Event - Undo
Started Event - User
Message Event - View
Image Tool Call Event - Warning
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
that folders containing files that could be modified to escalate the
privileges of the agent (e.g.
.codex,.git, notably.git/hooks) under a writable root are not modified by the agent.
Enums§
- Agent
Status - Agent lifecycle status, derived from emitted events.
- AskFor
Approval - Determines the conditions under which the user is consulted to approve running the command proposed by Codex.
- Auto
Context Phase - 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
Command Source - Exec
Output Stream - File
Change - Initial
History - Input
Message Kind - McpAuth
Status - McpServer
Failure Phase - McpStartup
Status - Network
Access - Represents whether outbound network access is available to the agent.
- Op
- Submission operation
- Review
Decision - User’s decision in response to an ExecApprovalRequest.
- Review
Delivery - Review
Target - Rollout
Item - Sandbox
Policy - Determines execution restrictions for model shell commands.
- Session
Source - Skill
Scope - SubAgent
Source - Truncation
Policy - Turn
Abort Reason
Constants§
- BROWSER_
SNAPSHOT_ CLOSE_ TAG - BROWSER_
SNAPSHOT_ OPEN_ TAG - COLLABORATION_
MODE_ CLOSE_ TAG - COLLABORATION_
MODE_ 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