Module protocol

Module protocol 

Source
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§

AgentMessageContentDeltaEvent
AgentMessageDeltaEvent
AgentMessageEvent
AgentReasoningDeltaEvent
AgentReasoningEvent
AgentReasoningRawContentDeltaEvent
AgentReasoningRawContentEvent
AgentReasoningSectionBreakEvent
BackgroundEventEvent
Chunk
CompactedItem
ConversationPathResponseEvent
Response payload for Op::GetHistory containing the current session’s in-memory transcript.
CreditsSnapshot
DeprecationNoticeEvent
ErrorEvent
Event
Event Queue Entry - events from agent
ExecCommandBeginEvent
ExecCommandEndEvent
ExecCommandOutputDeltaEvent
ExitedReviewModeEvent
FinalOutput
GetHistoryEntryResponseEvent
GitInfo
ItemCompletedEvent
ItemStartedEvent
ListCustomPromptsResponseEvent
Response payload for Op::ListCustomPrompts.
McpInvocation
McpListToolsResponseEvent
McpStartupCompleteEvent
McpStartupFailure
McpStartupUpdateEvent
McpToolCallBeginEvent
McpToolCallEndEvent
PatchApplyBeginEvent
PatchApplyEndEvent
RateLimitSnapshot
RateLimitWindow
RawResponseItemEvent
ReasoningContentDeltaEvent
ReasoningRawContentDeltaEvent
ResumedHistory
ReviewCodeLocation
Location of the code related to a review finding.
ReviewFinding
A single review finding describing an observed issue or recommendation.
ReviewLineRange
Inclusive line range in a file associated with the finding.
ReviewOutputEvent
Structured review result produced by a child review session.
ReviewRequest
Review request sent to the review session.
RolloutLine
SessionConfiguredEvent
SessionMeta
SessionMetaLine
StreamErrorEvent
StreamInfoEvent
Submission
Submission Queue Entry - requests from user
TaskCompleteEvent
TaskStartedEvent
TokenCountEvent
TokenUsage
TokenUsageInfo
TurnAbortedEvent
TurnContextItem
TurnDiffEvent
UndoCompletedEvent
UndoStartedEvent
UserMessageEvent
ViewImageToolCallEvent
WarningEvent
WebSearchBeginEvent
WebSearchEndEvent
WritableRoot
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§

AskForApproval
Determines the conditions under which the user is consulted to approve running the command proposed by Codex.
CodexErrorInfo
Codex errors that we expose to clients.
EventMsg
Response event from the agent NOTE: Make sure none of these values have optional types, as it will mess up the extension code-gen.
ExecCommandSource
ExecOutputStream
FileChange
InitialHistory
McpAuthStatus
McpStartupStatus
Op
Submission operation
ReviewDecision
User’s decision in response to an ExecApprovalRequest.
RolloutItem
SandboxPolicy
Determines execution restrictions for model shell commands.
SessionSource
SubAgentSource
TurnAbortReason

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

Traits§

HasLegacyEvent