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).
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.
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: EntryProposalstage: SampleStageThe proposer’s declaration of whether its sample had closed —
see SampleStage. Read once, by the held-steer release’s
assertion, and dropped.
mode: AckModeWhether the proposer waits for durability (commit-protocol.md
§Pipelined commits). Pipelined answers with a
ProposeReply::Ticket the moment the entries are forwarded.
reply: Sender<ProposeReply>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.
TurnFinished
Turn task → actor: the turn is over (or needs a compaction respawn).