pub enum SessionCommand {
Show 28 variants
Submit {
text: String,
attachments: Vec<Value>,
},
Steer {
text: String,
},
SubagentSteer {
handle_id: String,
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,
},
TakeInput,
Park,
AdoptWorkers {
workers: Vec<CarriedWorker>,
},
RestoreToolActivations {
activations: Vec<CarriedActivation>,
},
ArmPark,
ReloadAborted,
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.
SubagentSteer
Steer one of this session’s running subagents (sa_N) from its watch
view. Owner-only like Steer. The note also enters the MAIN
conversation as an event (no auto-turn), so the main agent knows the
user redirected its worker. Failure → Refused.
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 (/pin on|off, --keep-warm, /keep-warm on|off,
synaps daemon pin). Published on SessionHandle::pinned().
TakeInput
(B1) /takeover: the sending client takes input ownership in place,
like an --takeover attach without re-attaching. Not an input
command (a read-only client sends it); refused from an Observe
client, a no-op from the owner. Emits InputOwnerChanged{Takeover}
(Attach when nobody owned input).
Park
Host-only (never wire): park now if can_park() (reload rehydrates
a Parked session Parked). A no-op otherwise.
AdoptWorkers
Host-only (never wire): reload’s rehydrate hands the new image the
workers the old image stopped or still owed a wake
(SessionReloadRecord::workers). The actor re-registers their ids
against their archives and wakes the parent once per worker.
Fields
workers: Vec<CarriedWorker>RestoreToolActivations
Host-only (never wire): reload’s rehydrate hands the new image the
exact tool activations the session held in the previous image
(SessionReloadRecord::tool_activations). The runtime re-validates
and restores them at its first turn start; a parked session keeps
them for its unpark. Sent before anything can start a turn.
Fields
activations: Vec<CarriedActivation>ArmPark
Host-only (never wire): reload’s rehydrate, last, for a session that comes back Live. The old image’s park timer did not survive the exec and only an attach or detach arms a new one, so a session no client reconnects to stayed Live with zero clients forever. Arms the park grace as a detach does; a client reconnecting within it clears it. A no-op on a parked session.
ReloadAborted
Host-only (never wire): the reload this session checkpointed for did not exec (the exec failed, or the reload stopped after the checkpoints). The checkpoint’s reload fence lifts, and the workers the reload stopped are announced to this same image.
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).
Implementations§
Source§impl SessionCommand
impl SessionCommand
Sourcepub fn refused_while_reloading(&self) -> bool
pub fn refused_while_reloading(&self) -> bool
Refused while a daemon reload has checkpointed the session (its
reload fence is up) until the exec, or until the daemon reports the
exec failed: anything that starts a turn (a Steer with no turn
running is a Submit), changes the conversation or journal the
record points at, launches or steers work, or changes a setting the
record already carries. Cancel, answers, queries, saves and
attach/detach stay open.
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.