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::ExecApprovalRequestEvent;pub use crate::approvals::SandboxCommandAssessment;pub use crate::approvals::SandboxRiskLevel;
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 - Background
Event Event - Chunk
- Compacted
Item - 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. - McpInvocation
- McpList
Tools Response Event - McpStartup
Complete Event - McpStartup
Failure - McpStartup
Update Event - McpTool
Call Begin Event - McpTool
Call EndEvent - Patch
Apply Begin Event - Patch
Apply EndEvent - Rate
Limit Snapshot - Rate
Limit Window - RawResponse
Item Event - Reasoning
Content Delta Event - Reasoning
RawContent Delta Event - Resumed
History - Review
Code Location - Location of the code related to a review finding.
- 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.
- Rollout
Line - Session
Configured Event - Session
Meta - Session
Meta Line - Stream
Error Event - Stream
Info 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 - 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
top‑level VCS metadata directories (e.g.
.git) under a writable root are not modified by the agent.
Enums§
- 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
Command Source - Exec
Output Stream - File
Change - Initial
History - McpAuth
Status - McpStartup
Status - 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 - SubAgent
Source - Turn
Abort Reason
Constants§
- ENVIRONMENT_
CONTEXT_ CLOSE_ 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