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 (RFC 0005 §4.3,
RFC 0015 §4.3). The child’s control thread sets a paused flag; the loop
waits between turns until ControlMsg::Resume clears it. The control
thread keeps running while the loop is suspended, so Resume/Ping/
Cancel still arrive — Cancel always wins over a pause.
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 (RFC
0018 §5.2). 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 (fresh health/breaker — a repointed endpoint starts CLOSED,
§5.2 step 2), and adopts the new model. An in-flight complete_once is
NEVER torn; the transcript is CONTINUOUS (§5.3, no context reset). The
token is a credential carried on the wire like SpawnPayload’s — it
is NEVER logged (the swap event/logs carry transport+index only).
ToolResult
agentd 2.0 (RFC 0026 §2): 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
agentd 2.0 (RFC 0026 §7): the answer to an AgentMsg::BudgetRequest.
ok = proceed now; else wait wait_ms and ask again (wait/slow),
or the request is refused (reason); model = a degrade swap.
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