Skip to main content

Module action

Module action 

Source
Expand description

Self-tool dispatch.

The agentic loop’s tools come from connected MCP servers plus agentd’s own self-tools (subagent.spawn, …). A SelfHandler supplies those tool definitions and handles their calls in-process — distinct from the MCP dispatch path. This is the seam through which the model self-orchestrates: it calls subagent.spawn to split its instruction into delegated child agents. The model only asks; the supervisor is what enforces the depth and concurrency caps and narrows the child’s scope, so a compromised model cannot widen its own budget through this seam.

Enums§

ToolClass
The classes of tool the agentic loop offers the model. This boundary is what keeps two invariants true: a task tool reaches the model ONLY by being exported from a registered MCP server or registered in code by the embedder, and nothing in the catalogue shells out to a local command. EVERY tool the loop advertises is exactly one of these classes; there is no third “general capability library” that could smuggle in an unaudited capability.

Constants§

SELF_CONTROL_TOOLS
The authoritative membership of the ToolClass::SelfControl class: every self/control primitive name agentd may offer the model. The SelfHandler advertises a depth-/feature-conditioned SUBSET of this set (a2a.delegate only with peers; schedule/subscribe/unsubscribe only at the root; the subagent.* delegation tools only within the depth budget), and the runner adds resource.read when any resource is readable. A test asserts that everything a handler can advertise appears in this list, so a new self-tool cannot silently escape the class boundary. By construction the set contains no local-execution primitive.

Traits§

SelfHandler
Provides agentd’s in-process self-tools to the loop. The loop tries the self-handler first; a None result means “not a self-tool — fall through to MCP”.