pub enum ControlMsg {
Spawn(Box<SpawnPayload>),
Ping {
seq: u64,
},
Pause,
Resume,
Cancel {
reason: String,
},
Inject {
message: String,
},
SwapIntel(Box<SwapIntel>),
ToolResult {
id: u64,
result: Value,
is_error: bool,
},
BudgetGrant {
id: u64,
ok: bool,
wait_ms: u64,
model: Option<String>,
reason: Option<String>,
},
}Variants§
Spawn(Box<SpawnPayload>)
The first frame: everything the child needs to run. Sent exactly once.
Ping
Liveness probe; the child’s control thread answers AgentMsg::Pong.
Pause
Suspend the agentic loop at its next turn boundary. The child’s control
thread sets a paused flag; the loop waits between turns until
ControlMsg::Resume clears it. Pausing at a boundary and never
mid-turn keeps the transcript coherent — a half-finished model call is
never abandoned. The control thread keeps running while the loop is
suspended, so Resume/Ping/Cancel still arrive, and Cancel always
wins over a pause so a paused child can still be drained.
Resume
Clear a prior ControlMsg::Pause: the loop resumes at the next turn.
Cancel
Ask the child to wind down at the next turn boundary (graceful).
Inject
Inject a message into the child’s running warm session (parent send /
reactive continue); forwarded to the loop by the control reader thread.
SwapIntel(Box<SwapIntel>)
Hot-swap the child’s intelligence config at its next turn boundary. Sent
by the supervisor’s reload fan-out to every in-flight child when a
reload’s diff touches intelligence/model/model_swap — the same
fan-out shape as ControlMsg::Pause, with a payload. The child’s
control thread stores it into a child-local LIVE handle; the agentic loop
reads it ONCE at the next turn boundary (where pause_wait sits),
rebuilds its crate::intel::client::IntelClient from the new endpoint
list, and adopts the new model. The rebuilt client starts with fresh
health and a CLOSED breaker, because breaker state describes the endpoint
that was just replaced and must not condemn the new one. An in-flight
complete_once is NEVER torn and the transcript stays CONTINUOUS, so a
swap costs no context. The token is a credential carried on the wire
like SpawnPayload’s and is NEVER logged — the swap event and logs
carry transport and endpoint index only.
ToolResult
The answer to an AgentMsg::ToolRequest — the supervisor executed the
internal tool; result is the tool’s output (or an error message when
is_error).
BudgetGrant
The answer to an AgentMsg::BudgetRequest. ok means proceed now;
otherwise wait wait_ms and ask again, or the request is refused with a
reason. A model names a cheaper model to degrade to.
Trait Implementations§
Source§impl Clone for ControlMsg
impl Clone for ControlMsg
Source§fn clone(&self) -> ControlMsg
fn clone(&self) -> ControlMsg
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more