#[non_exhaustive]pub enum Op {
Show 15 variants
Interrupt,
UserInput {
items: Vec<UserInput>,
},
UserTurn {
items: Vec<UserInput>,
cwd: PathBuf,
approval_policy: AskForApproval,
sandbox_policy: SandboxPolicy,
model: String,
effort: Option<ReasoningEffort>,
summary: ReasoningSummary,
final_output_json_schema: Option<Value>,
},
OverrideTurnContext {
cwd: Option<PathBuf>,
approval_policy: Option<AskForApproval>,
sandbox_policy: Option<SandboxPolicy>,
model: Option<String>,
effort: Option<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,
ListCustomPrompts,
Compact,
Undo,
Review {
review_request: ReviewRequest,
},
Shutdown,
RunUserShellCommand {
command: String,
},
}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: PathBufcwd to use with the SandboxPolicy and potentially tool calls
such as local_shell.
approval_policy: AskForApprovalPolicy to use for command approval.
sandbox_policy: SandboxPolicyPolicy to use for tool calls such as local_shell.
model: StringMust be a valid model slug for the [crate::client::ModelClient]
associated with this conversation.
effort: Option<ReasoningEffort>Will only be honored if the model is configured to use reasoning.
summary: ReasoningSummaryWill 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<Option<ReasoningEffort>>Updated reasoning effort (honored only for reasoning-capable models).
Use Some(Some(_)) to set a specific effort, Some(None) to clear
the effort, or None to leave the existing value unchanged.
summary: Option<ReasoningSummary>Updated reasoning summary preference (honored only for reasoning-capable models).
ExecApproval
Approve a command execution
Fields
decision: ReviewDecisionThe user’s decision in response to the request.
PatchApproval
Approve a code patch
Fields
decision: ReviewDecisionThe 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.
ListCustomPrompts
Request the list of available custom prompts.
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.
Undo
Request Codex to undo a turn (turn are stacked so it is the same effect as CMD + Z).
Review
Request a code review from the agent.
Fields
review_request: ReviewRequestShutdown
Request to shut down codex instance.
RunUserShellCommand
Execute a user-initiated one-off shell command (triggered by “!cmd”).
The command string is executed using the user’s default shell and may
include shell syntax (pipes, redirects, etc.). Output is streamed via
ExecCommand* events and the UI regains control upon TaskComplete.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Op
impl<'de> Deserialize<'de> for Op
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Op
impl JsonSchema for Op
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more