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 (RFC 0003).
Pong
Answer to a ControlMsg::Ping.
Event
A progress event (loop.step, tool.call, …) — also resets the
no-progress watchdog (Detector B, RFC 0003). fields is opaque to the
supervisor except for correlation.
Usage(Usage)
Incremental token/step usage for hierarchical accounting (RFC 0003).
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 (RFC 0008
§spawn-vs-continue). 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 (RFC 0021 §7): 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 (RFC 0018 §6). 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). The
supervisor has no LLM of its own and no live view of a child’s breaker
state, so the child reports it upward; the supervisor latches it into the
intel_all_down process-global the readiness probe + agentd_intel_all_down
gauge + agentd://intelligence/capacity bodies read (the one latched
truth, eventually-consistent — see crate::signals::set_intel_all_down).
active is best-effort transport+index ONLY — NEVER a URL or credential
(mirrors the agentd://intelligence redaction, RFC 0012 §3.7).
ToolRequest
agentd 2.0 (RFC 0026 §2): a turn worker / subagent asks the supervisor
to execute an internal tool (memory, plan, subagent.run, sleep…) —
state changes are made by the state owner. Answered by
ControlMsg::ToolResult with the same id.
BudgetRequest
agentd 2.0 (RFC 0026 §7): budget admission before a model call.
Answered by ControlMsg::BudgetGrant.
TurnDone
agentd 2.0: a Role::Turn worker finished its turn (terminal for the
worker). Carries the transcript delta, the usage, and the outcome.
Fields
turn: Box<TurnResult>