pub enum AgentMsg {
Show 13 variants
Ready,
Pong {
seq: u64,
},
Event {
event: String,
fields: Value,
},
Usage(Usage),
Turn {
outcome: Outcome,
},
Result {
outcome: Outcome,
},
Failed {
error: String,
},
Gate {
node: String,
payload: Value,
},
GateClosed {
node: String,
via: String,
},
IntelHealth {
all_down: bool,
active: Option<IntelActive>,
},
ToolRequest {
id: u64,
name: String,
args: Value,
},
BudgetRequest {
id: u64,
estimate: u64,
},
TurnDone {
turn: Box<TurnResult>,
},
}Variants§
Ready
Setup done (intel + scoped MCP connected); the child is about to loop. The supervisor’s crash-on-spawn fast-fail waits for this frame, so a child that dies during setup is detected without waiting for a deadline.
Pong
Answer to a ControlMsg::Ping.
Event
A progress event (loop.step, tool.call, …). Arrival also resets the
supervisor’s no-progress watchdog, so a child doing visible work is never
reaped for silence. fields is opaque to the supervisor except for
correlation.
Usage(Usage)
Incremental token/step usage, which the supervisor folds into the tree’s hierarchical accounting so a subtree cannot outspend the tree ceiling.
Turn
A warm session finished one turn (its reaction to one delivered
event) and stays alive for the next. Carries that turn’s distilled
outcome; unlike AgentMsg::Result it is not terminal, so the
supervisor must not reap the child on seeing it. The supervisor applies
the turn’s self-schedule / self-subscribe effects and may then Inject
the next event.
Result
Terminal: the distilled result + final status. Sent exactly once.
Failed
Terminal: a fatal infrastructure failure (intel/mcp unreachable).
Gate
A HUMAN GATE opened: a workflow human node suspended awaiting input.
node is the workflow node id; payload is the resolved
gate payload (what the human is being asked to look at). The supervisor
records it (the served A2A task projects input-required, the gate
resource serves the payload) and later fans the human’s reply DOWN as
ControlMsg::Inject. Non-terminal; also progress for liveness.
GateClosed
The gate resolved (via = "reply" | "uri" | "timeout"): the
supervisor clears the recorded gate and the A2A task returns to
working. Non-terminal.
IntelHealth
The child’s intelligence reachability, edge-triggered at the breaker /
failover seam. Emitted ONLY on a transition: on entering
all-endpoints-down (every configured endpoint’s breaker open, the
failover sweep exhausted) and on recovering (any endpoint usable
again). Edge-triggering keeps a wedged fleet from flooding the control
channel. The supervisor has no LLM of its own and no live view of a
child’s breaker state, so the child is the only party that can report
this; the supervisor latches it into the intel_all_down process-global
that the readiness probe, the agentd_intel_all_down gauge, and the
agentd://intelligence / capacity bodies all read — one latched truth,
eventually consistent (see crate::signals::set_intel_all_down).
active is best-effort transport and index ONLY — never a URL or a
credential, matching what the agentd://intelligence resource redacts.
ToolRequest
A turn worker / subagent asks the supervisor to execute an internal
tool (memory, plan, subagent.run, sleep…). These round-trip rather than
run in the child because the supervisor owns that state; letting a child
mutate it directly would let concurrent children race each other.
Answered by ControlMsg::ToolResult with the same id.
BudgetRequest
Budget admission asked for before a model call, answered by
ControlMsg::BudgetGrant. Asking first is what lets the supervisor
shape spend across the whole tree instead of after the fact.
TurnDone
A Role::Turn worker finished its turn — terminal for that worker.
Carries the transcript delta, the usage, and the outcome.
Fields
turn: Box<TurnResult>