Skip to main content

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.

Structs§

AgentMessageDeltaEvent
AgentMessageEvent
AgentReasoningDeltaEvent
AgentReasoningEvent
AgentReasoningRawContentDeltaEvent
AgentReasoningRawContentEvent
AgentReasoningSectionBreakEvent
ApplyPatchApprovalRequestEvent
BackgroundEventEvent
BrowserSnapshotEvent
Chunk
CompactedItem
CompactionCheckpointWarningEvent
ConversationPathResponseEvent
Response payload for Op::GetHistory containing the current session’s in-memory transcript.
EnvironmentContextDeltaEvent
EnvironmentContextFullEvent
ErrorEvent
Event
Event Queue Entry - events from agent
ExecApprovalRequestEvent
ExecCommandBeginEvent
ExecCommandEndEvent
ExecCommandOutputDeltaEvent
ExitedReviewModeEvent
FinalOutput
GetHistoryEntryResponseEvent
GitInfo
ListCustomPromptsResponseEvent
Response payload for Op::ListCustomPrompts.
ListSkillsResponseEvent
Response payload for Op::ListSkills.
McpInvocation
McpListToolsResponseEvent
Response payload for Op::ListMcpTools.
McpToolCallBeginEvent
McpToolCallEndEvent
OrderMeta
PatchApplyBeginEvent
PatchApplyEndEvent
RateLimitSnapshot
RateLimitWindow
RecordedEvent
Lightweight representation of an event suitable for persistence and replay.
ReplayHistoryEvent
Payload for ReplayHistory containing prior ResponseItems.
ResumedHistory
ReviewCodeLocation
Location of the code related to a review finding.
ReviewContextMetadata
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.
ReviewSnapshotInfo
Git/worktree context captured at review time.
RolloutLine
SessionConfiguredEvent
SessionMeta
SessionMetaLine
StreamErrorEvent
Submission
Submission Queue Entry - requests from user
TaskCompleteEvent
TaskStartedEvent
TokenCountEvent
TokenUsage
TokenUsageInfo
TurnAbortedEvent
TurnContextItem
TurnDiffEvent
UserMessageEvent
ViewImageToolCallEvent
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§

ApprovedCommandMatchKind
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.
ExecOutputStream
FileChange
InitialHistory
InputItem
User input
InputMessageKind
Op
Submission operation
ReviewDecision
User’s decision in response to an ExecApprovalRequest.
RolloutItem
SandboxPolicy
Determines execution restrictions for model shell commands.
SessionSource
TruncationPolicy
TurnAbortReason

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