pub enum Op {
Show 34 variants
SendMessage(TurnSpec),
Steer {
content: String,
},
ContinueGoal {
dynamic_tools: Vec<DynamicToolSpec>,
engine_schedule_id: Option<u64>,
},
RunShellCommand {
command: String,
mode: String,
allow_shell: bool,
trust_mode: bool,
auto_approve: bool,
approval_mode: String,
},
SetGoalStatus {
status: String,
clear: bool,
goal_id: Option<String>,
},
SetGoalObjective {
objective: String,
token_budget: Option<u32>,
goal_id: Option<String>,
},
Cancel,
Shutdown,
PreviewOutboundRequest {Show 16 fields
json: bool,
base_prompt_only: bool,
mode: String,
allow_shell: bool,
trust_mode: bool,
auto_approve: bool,
approval_mode: String,
allowed_tools: Option<Vec<String>>,
dynamic_tools: Vec<DynamicToolSpec>,
provenance: String,
requested_model: String,
requested_reasoning: String,
auto_model: bool,
hypothetical_prompt_supplied: bool,
hypothetical_prompt: Option<String>,
unresolved: Option<String>,
},
ListSubAgents,
GetSubAgentSettlement,
CancelSubAgent {
agent_id: String,
},
FollowUpSubAgent {
agent_id: String,
text: String,
},
ChangeMode {
mode: String,
allow_shell: bool,
trust_mode: bool,
auto_approve: bool,
approval_mode: String,
configured_sandbox_mode: Option<String>,
},
SetModel {
model: String,
mode: String,
route_limits: Option<RouteLimits>,
},
SetCompaction {
config: CompactionPolicy,
},
SetPermissionRuleset {
ruleset: Value,
},
SetStreamChunkTimeout {
timeout_secs: u64,
},
SetSubagentRuntimeConfig {
enabled: bool,
max_subagents: u64,
launch_concurrency: u64,
max_spawn_depth: u32,
api_timeout_secs: u64,
heartbeat_timeout_secs: u64,
},
SetSearchProvider {
provider: String,
},
SetFleetRoster {
member_ids: Vec<String>,
exact_selection: bool,
load_error: Option<String>,
},
SyncSession {
engine_session_id: Option<String>,
messages: Vec<Value>,
system_prompt: Option<Value>,
system_prompt_override: bool,
model: String,
workspace: PathBuf,
mode: String,
},
RewindConversation {
expected: Value,
messages: Vec<Value>,
},
CompactContext {
id: String,
model: String,
model_provider: String,
compaction: CompactionPolicy,
},
CancelCompaction {
id: String,
},
GetSessionSnapshot,
GetContextBudget,
GetProviderRuntimeStatus,
BootstrapMcp,
RetryMcpServer {
name: String,
},
ReloadMcp {
config_path: PathBuf,
},
PurgeContext,
EditLastTurn {
new_message: String,
},
SetAdvisorEnabled {
enabled: bool,
},
}Expand description
Operations that can be submitted to the core engine. This is the
protocol view of crates/tui/src/core/ops::Op — same lifecycle,
same provenance gate — but serializable and free of mpsc / oneshot
fields. In-process callers convert at the boundary; out-of-process
callers send the JSON directly.
Variants§
SendMessage(TurnSpec)
Drive one model turn: role=user content plus the resolved route
receipt the engine will freeze at the client-freeze boundary. Headless
and TUI must produce byte-identical MessageRequests for identical
Op::SendMessage payloads.
Steer
Steer an in-flight turn with additional user content (drains into
the turn loop’s rx_steer channel).
ContinueGoal
Re-check and dispatch a goal continuation (synthetic turn that continues the same logical goal run).
Fields
dynamic_tools: Vec<DynamicToolSpec>engine_schedule_id: Option<u64>Engine-owned coalescing token; direct callers send None.
Enforced, not merely documented: the engine mints these on an
in-process channel (tx_op.try_send) and they never cross serde,
so any value arriving through deserialization came from outside.
The IDs are predictable per-session counters, and a matching guess
is treated as an already-delayed internal token – it would consume
the pending schedule and skip the host-injected quiet period. Wire
input is therefore always dropped to None.
RunShellCommand
Execute a local composer shell command without a model turn.
Fields
SetGoalStatus
Set goal status without dispatching a model turn.
SetGoalObjective
Set (or replace) the active goal objective and start goal work.
Cancel
Shutdown
PreviewOutboundRequest
Describe the exact request the next turn would send without sending it
(/dryrun / /preview-request, #1004). Headless and TUI must render
identical manifests for identical inputs.
Fields
dynamic_tools: Vec<DynamicToolSpec>ListSubAgents
GetSubAgentSettlement
Inspect live children and pending handbacks at the Engine’s idle boundary. The host owns the response channel; it is not wire input.
CancelSubAgent
FollowUpSubAgent
ChangeMode
Fields
SetModel
SetCompaction
Fields
config: CompactionPolicySetPermissionRuleset
Legacy serialized permission-update operation, retained for wire compatibility. The in-process runtime now publishes directly through its shared policy store instead of queuing a second replacement.
SetStreamChunkTimeout
SetSubagentRuntimeConfig
Fields
SetSearchProvider
SearchProvider in snake_case.
SetFleetRoster
Replace the engine’s merged Fleet roster. Only the roster’s identity crosses: member ids in precedence order plus the load state.
SyncSession
Sync engine session state (resume/load). messages are transcript
Messages and system_prompt a SystemPrompt, both serialized.
Fields
RewindConversation
Rewind an unchanged conversation. expected is the complete observed
session snapshot; a receiver must compare it before changing history.
The success/refusal receipt travels out-of-band.
CompactContext
Run context compaction on one exact provider route.
CancelCompaction
GetSessionSnapshot
Request a session snapshot; the reply travels out-of-band.
GetContextBudget
Request the live context-window budget for the session’s route; the reply travels out-of-band.
GetProviderRuntimeStatus
Request provider concurrency state; the reply travels out-of-band.
BootstrapMcp
Populate the engine-owned MCP pool once at boot; reply out-of-band.