Skip to main content

SessionCommand

Enum SessionCommand 

Source
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

§text: String
§attachments: Vec<Value>

Pre-built canonical user content blocks (images, documents) produced by PendingAttachments::build_content on the client. Empty ⇔ text-only (backward compatible).

§

Steer

Text typed while streaming. Actor: steer if a steer_tx is live else queue; ALWAYS also sets queued_message.

Fields

§text: String
§

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.

Fields

§handle_id: String
§text: String
§

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.

Fields

§prompt_id: u64
§

Set

id is client-chosen and echoed in SettingChanged.id.

Fields

§id: u64
§

Compact

Fields

§instructions: Option<String>
§

NewSession

/new: ConversationState::clear.

§

Save

§

Query

Reply = SessionEventWire::QueryResult { id, value }.

Fields

§id: u64
§

Attach

Reply = Attached { client_id, … } on THIS client’s channel only.

Fields

§client: ClientMeta
§

Detach

Fields

§client: ClientId
§

End

Host shutdown of this session: save → on_session_end → leases → Ended.

Fields

§reason: EndReason
§

Resync

Resync after Lagged (B, day 3): actor re-sends history + turn_replay.

Fields

§client: ClientId
§since_seq: u64
§

EngineCommand

Runtime-backed slash command (engine::commands::handle_engine_command: /model /thinking /context /trace /memory /compact …). Reply = QueryResult { id, value: {"kind": .., "text": ..} }.

Fields

§id: u64
§name: String
§

SubmitPrepared

(A3) dispatch.rs LoadSkill — pre-built tool_use/tool_result pair (+ optional user text) then a turn. Does NOT reset consecutive_auto_turns.

Fields

§messages: Vec<SharedMessage>
§user_text: Option<String>
§

PluginCommand

(A3) tools-backed (non-interactive) plugin command on THE runtime’s tool set. Reply = QueryResult{id, {kind:"plugin_output", ..}}.

Fields

§id: u64
§plugin: String
§name: String
§

Resume

(A3) /resume: save current, load query, restore model/reasoning/ system prompt, swap conversation. Reply = Resumed{id, ..}.

Fields

§id: u64
§query: String
§

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

§

KeepWarm

(B3) pin/unpin (/pin on|off, --keep-warm, /keep-warm on|off, synaps daemon pin). Published on SessionHandle::pinned().

Fields

§on: bool
§

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

§

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).

Fields

§plugin: String
§command: String

Implementations§

Source§

impl SessionCommand

Source

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SessionCommand

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SessionCommand

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more