#[non_exhaustive]pub enum Op {
Show 18 variants
Interrupt,
UserInput {
items: Vec<InputItem>,
final_output_json_schema: Option<Value>,
},
QueueUserInput {
items: Vec<InputItem>,
},
UserTurn {
items: Vec<InputItem>,
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,
},
RegisterApprovedCommand {
command: Vec<String>,
match_kind: ApprovedCommandMatchKind,
semantic_prefix: Option<Vec<String>>,
},
PatchApproval {
id: String,
decision: ReviewDecision,
},
AddToHistory {
text: String,
},
PersistHistorySnapshot {
snapshot: Value,
},
GetHistoryEntryRequest {
offset: usize,
log_id: u64,
},
GetPath,
ListMcpTools,
ListCustomPrompts,
ListSkills,
Compact,
Review {
review_request: ReviewRequest,
},
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
Fields
QueueUserInput
Queue user input to be appended to the next model request without interrupting the current turn.
UserTurn
Similar to Op::UserInput, but contains additional context required
for a turn of a [crate::code_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.
RegisterApprovedCommand
Register a command pattern as approved for the remainder of the session.
Fields
match_kind: ApprovedCommandMatchKindPatchApproval
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.
PersistHistorySnapshot
Persist the full chat history snapshot for the current session.
GetHistoryEntryRequest
Request a single history entry identified by log_id + offset.
GetPath
Request the full in-memory conversation transcript for the current session.
Reply is delivered via EventMsg::ConversationHistory.
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.
ListSkills
Request the list of available skills.
Reply is delivered via EventMsg::ListSkillsResponse.
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.
Review
Request a code review from the agent.
Fields
review_request: ReviewRequestShutdown
Request to shut down codex instance.