#[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: 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: ReasoningEffortWill 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<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: 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.
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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Op
impl<'de> Deserialize<'de> for Op
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Op, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Op, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Op
impl Serialize for Op
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Op
Auto Trait Implementations§
impl Freeze for Op
impl RefUnwindSafe for Op
impl Send for Op
impl Sync for Op
impl Unpin for Op
impl UnwindSafe for Op
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more