Skip to main content

SessionCmd

Enum SessionCmd 

Source
pub enum SessionCmd {
    Prompt(String),
    PromptTagged {
        text: String,
        synthetic: SyntheticReason,
    },
    Continue,
    Steer(String),
    Rename(String),
    SetMode(PermissionMode),
    SetTodos(Vec<Todo>),
    Propose {
        entries: Vec<EntryPayload>,
        reply: Sender<bool>,
    },
    ProposePrepared {
        proposal: EntryProposal,
        stage: SampleStage,
        mode: AckMode,
        reply: Sender<ProposeReply>,
    },
    WriteBlob {
        tool_use_id: String,
        content: String,
        reply: Sender<Result<String, String>>,
    },
    TurnFinished {
        end: TurnEnd,
        usage: TokenUsage,
    },
    // some variants omitted
}

Variants§

§

Prompt(String)

A user prompt. Starts a turn, or queues (one-at-a-time promotion).

§

PromptTagged

A prompt whose committed item carries a provenance tag (T2: schema contract + validation-retry feedback ride in as tagged user items).

Fields

§text: String
§

Continue

Continue an interrupted turn (M4/#8): sample against the current projection with no new user item — used on resume when the last item is a user/tool turn the model never answered. No-op if already running.

§

Steer(String)

Mid-turn guidance: admitted durably now, woven into the next sample.

§

Rename(String)

Set the session’s display name (durable: appended to the log).

§

SetMode(PermissionMode)

Set the session’s effective permission mode (durable: appended to the log as ModeSet; takes effect immediately — no Rules reallocation).

§

SetTodos(Vec<Todo>)

Full-state replace of the todo_write checklist (durable: appended to the log as Todos, last-wins on replay — same shape as Rename/SetMode). The actor is the list’s sole owner; the tool only ever forwards a validated Vec<Todo> here.

§

Propose

Pre-actor proposal path (durable-ack before reply): the ONLY caller left is question_sink’s PendingQuestion/QuestionResolved entries, built and sent before the actor (and its masker) exist yet — see question_sink’s doc comment on why it can’t reach SharedDeps. Those entries are always human-sized (a question header/prompt/options), so they stay on the actor-serializing inline path, the same carve-out commit-protocol.md §Proposal payloads grants steer admissions/compaction digests/todo snapshots. A turn-task proposal uses SessionCmd::ProposePrepared instead — see that variant’s doc comment for why this one can’t be reused for that.

Fields

§reply: Sender<bool>
§

ProposePrepared

Turn task → actor: commit already-prepared entries (commit-protocol.md §Proposal payloads). This is the type-level enforcement point requirement 4 of task 8 asks for: a turn-originated proposal can only reach the log through this channel, so a future call site cannot reintroduce actor-side serialization for these kinds — the entries carry pre-serialized, pre-masked PreparedPayload bytes, never a raw EntryPayload.

Fields

§proposal: EntryProposal
§stage: SampleStage

The proposer’s declaration of whether its sample had closed — see SampleStage. Read once, by the held-steer release’s assertion, and dropped.

§mode: AckMode

Whether the proposer waits for durability (commit-protocol.md §Pipelined commits). Pipelined answers with a ProposeReply::Ticket the moment the entries are forwarded.

§

WriteBlob

Turn task → actor: write an oversized tool result to a masked blob (T4 — the actor owns the log, the turn never touches it directly). Replies Ok(path) on success; on write failure the content is handed back in Err so eviction never loses data.

Fields

§tool_use_id: String
§content: String
§

TurnFinished

Turn task → actor: the turn is over (or needs a compaction respawn).

Fields

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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