pub enum SessionCommand {
Show 22 variants
Submit {
text: String,
attachments: Vec<Value>,
},
Steer {
text: String,
},
Cancel,
Answer {
prompt_id: u64,
value: Option<String>,
},
Set {
id: u64,
setting: SessionSetting,
},
Compact {
instructions: Option<String>,
},
NewSession,
Save,
Query {
id: u64,
query: SessionQuery,
},
Attach {
client: ClientMeta,
mode: AttachMode,
},
Detach {
client: ClientId,
},
End {
reason: EndReason,
},
Resync {
client: ClientId,
since_seq: u64,
},
EngineCommand {
id: u64,
name: String,
arg: String,
},
SubmitPrepared {
messages: Vec<SharedMessage>,
user_text: Option<String>,
},
PluginCommand {
id: u64,
plugin: String,
name: String,
arg: String,
},
Resume {
id: u64,
query: String,
},
Checkpoint {
reason: CheckpointReason,
},
KeepWarm {
on: bool,
},
Park,
HostEvent(HostEvent),
DriverStart {
plugin: String,
command: String,
arg: String,
},
}Expand description
The entire client→session control surface (SEAMS §5.2/§5.3).
Debug is manual: Submit/Steer/SubmitPrepared/Answer/Resume
print <redacted> (no lengths) so a command can be traced by type.
Variants§
Submit
User-authored prompt. Actor: reset auto-turn counter, push user msg verbatim, start turn.
Fields
Steer
Text typed while streaming. Actor: steer if a steer_tx is live else queue; ALWAYS also sets queued_message.
Cancel
Esc. Cancel, adopt the turn’s partial history + append the
interruption marker (engine::interrupt), dequeue, flush pending
events, cancel subagents, save.
Answer
Answer to a PromptRequest. None = cancelled.
NEVER journaled, NEVER replayed, NEVER traced.
Set
id is client-chosen and echoed in SettingChanged.id.
Compact
NewSession
/new: ConversationState::clear.
Save
Query
Reply = SessionEventWire::QueryResult { id, value }.
Attach
Reply = Attached { client_id, … } on THIS client’s channel only.
Detach
End
Host shutdown of this session: save → on_session_end → leases → Ended.
Resync
Resync after Lagged (B, day 3): actor re-sends history + turn_replay.
EngineCommand
Runtime-backed slash command (engine::commands::handle_engine_command:
/model /thinking /context /trace /memory /compact …). Reply =
QueryResult { id, value: {"kind": .., "text": ..} }.
SubmitPrepared
(A3) dispatch.rs LoadSkill — pre-built tool_use/tool_result pair (+ optional user text) then a turn. Does NOT reset consecutive_auto_turns.
PluginCommand
(A3) tools-backed (non-interactive) plugin command on THE runtime’s
tool set. Reply = QueryResult{id, {kind:"plugin_output", ..}}.
Resume
(A3) /resume: save current, load query, restore model/reasoning/
system prompt, swap conversation. Reply = Resumed{id, ..}.
Checkpoint
(B1, used by C3 reload) cancel any turn (partial history + marker),
abort compaction, save, close PTYs, emit Notice. Never ends the
session. Reply = QueryResult{id: CHECKPOINT_QUERY_ID, {ok:true}}.
Fields
reason: CheckpointReasonKeepWarm
(B3) pin/unpin (--keep-warm, /keep-warm on|off).
Park
Host-only (never wire): park now if can_park() (reload rehydrates
a Parked session Parked). A no-op otherwise.
HostEvent(HostEvent)
Host→session (never wire): the actor re-emits as SessionEventWire.
DriverStart
(E-P0) Start or re-arm the session driver for plugin.
command is the interactive command name (e.g. “auto”);
arg is everything after the command (“start – do X”).
No DriverStop — Cancel handles that (§2).
Trait Implementations§
Source§impl Debug for SessionCommand
impl Debug for SessionCommand
Source§impl<'de> Deserialize<'de> for SessionCommand
impl<'de> Deserialize<'de> for SessionCommand
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>,
Auto Trait Implementations§
impl Freeze for SessionCommand
impl RefUnwindSafe for SessionCommand
impl Send for SessionCommand
impl Sync for SessionCommand
impl Unpin for SessionCommand
impl UnsafeUnpin for SessionCommand
impl UnwindSafe for SessionCommand
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>. Box<dyn Any> can
then be further downcast into Box<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>. Rc<Any> 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.