#[non_exhaustive]pub enum Op {
Interrupt,
UserInput {
items: Vec<InputItem>,
},
UserTurn {
items: Vec<InputItem>,
cwd: PathBuf,
approval_policy: AskForApproval,
sandbox_policy: SandboxPolicy,
model: String,
effort: ReasoningEffort,
summary: ReasoningSummary,
},
OverrideTurnContext {
cwd: Option<PathBuf>,
approval_policy: Option<AskForApproval>,
sandbox_policy: Option<SandboxPolicy>,
model: Option<String>,
effort: Option<ReasoningEffort>,
summary: Option<ReasoningSummary>,
},
ExecApproval {
id: String,
decision: ReviewDecision,
},
PatchApproval {
id: String,
decision: ReviewDecision,
},
AddToHistory {
text: String,
},
GetHistoryEntryRequest {
offset: usize,
log_id: u64,
},
ListMcpTools,
Compact,
Shutdown,
}
Expand description
Submission operation
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Interrupt
Abort current task.
This server sends EventMsg::TurnAborted
in response.
UserInput
Input from the user
UserTurn
Similar to Op::UserInput
, but contains additional context required
for a turn of a [crate::codex_conversation::CodexConversation
].
Fields
cwd: PathBuf
cwd
to use with the SandboxPolicy
and potentially tool calls
such as local_shell
.
approval_policy: AskForApproval
Policy to use for command approval.
sandbox_policy: SandboxPolicy
Policy to use for tool calls such as local_shell
.
model: String
Must be a valid model slug for the [crate::client::ModelClient
]
associated with this conversation.
effort: ReasoningEffort
Will only be honored if the model is configured to use reasoning.
summary: ReasoningSummary
Will only be honored if the model is configured to use reasoning.
OverrideTurnContext
Override parts of the persistent turn context for subsequent turns.
All fields are optional; when omitted, the existing value is preserved.
This does not enqueue any input – it only updates defaults used for
future UserInput
turns.
Fields
approval_policy: Option<AskForApproval>
Updated command approval policy.
sandbox_policy: Option<SandboxPolicy>
Updated sandbox policy for tool calls.
effort: Option<ReasoningEffort>
Updated reasoning effort (honored only for reasoning-capable models).
summary: Option<ReasoningSummary>
Updated reasoning summary preference (honored only for reasoning-capable models).
ExecApproval
Approve a command execution
Fields
decision: ReviewDecision
The user’s decision in response to the request.
PatchApproval
Approve a code patch
Fields
decision: ReviewDecision
The user’s decision in response to the request.
AddToHistory
Append an entry to the persistent cross-session message history.
Note the entry is not guaranteed to be logged if the user has history disabled, it matches the list of “sensitive” patterns, etc.
GetHistoryEntryRequest
Request a single history entry identified by log_id
+ offset
.
ListMcpTools
Request the list of MCP tools available across all configured servers.
Reply is delivered via EventMsg::McpListToolsResponse
.
Compact
Request the agent to summarize the current conversation context. The agent will use its existing context (either conversation history or previous response id) to generate a summary which will be returned as an AgentMessage event.
Shutdown
Request to shut down codex instance.