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
Chunk
ErrorEvent
Event
Event Queue Entry - events from agent
ExecApprovalRequestEvent
ExecCommandBeginEvent
ExecCommandEndEvent
ExecCommandOutputDeltaEvent
FinalOutput
GetHistoryEntryResponseEvent
McpInvocation
McpListToolsResponseEvent
Response payload for Op::ListMcpTools.
McpToolCallBeginEvent
McpToolCallEndEvent
PatchApplyBeginEvent
PatchApplyEndEvent
SessionConfiguredEvent
Submission
Submission Queue Entry - requests from user
TaskCompleteEvent
TokenUsage
TurnAbortedEvent
TurnDiffEvent
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.
EventMsg
Response event from the agent
ExecOutputStream
FileChange
InputItem
User input
Op
Submission operation
ReviewDecision
User’s decision in response to an ExecApprovalRequest.
SandboxPolicy
Determines execution restrictions for model shell commands.
TurnAbortReason