class

Smith::Subagents::Supervisor

Inherits Reference < Object

Constants

MAX_CHILDREN_PER_SESSION = 20
MAX_DEPTH = 3

The main agent is depth 0, so this allows three levels of children.

Constructors

new(approver : Smith::Tools::Approver = Smith::Tools::AutoApprover.new, max_depth : Int32 = MAX_DEPTH, budget : SpawnBudget | Nil = nil, depth : Int32 = 0, node_path : String = "", warn_io : IO = STDERR)
Source

Instance methods

approver
Source
budget
Source
child_supervisor(node_path : String) : Supervisor

The supervisor a child agent would need in order to delegate further. Nothing registers the agent tool for children today, so this is currently only reached from the specs — but the limits are wired here, so whoever does register it (see #21) inherits them instead of reinventing them.

Source
children_may_nest?

Whether a child of this supervisor could itself delegate. Used to decide whether offering the agent tool is worth the tokens.

Source
count
Source
depth
Source
max_depth
Source
plan_mode

Plan mode is a property of the whole run, not just the main thread: without this, agent(mode: "work") would be a trivial way around it.

Source
plan_mode=(plan_mode : Bool)

Plan mode is a property of the whole run, not just the main thread: without this, agent(mode: "work") would be a trivial way around it.

Source
provider_factory

Children build their own registry, so without the approver a work-mode subagent would run bash straight past the parent's approval gate.

node_path is this supervisor's own position ("2.1"), which its children extend — an id is then unambiguous across levels. A definition may name a different provider, but building one needs API keys and config that belong in the CLI — so the CLI injects a factory rather than having that logic duplicated here.

Source
provider_factory=(provider_factory : Proc(String, Smith::LLM::Provider) | Nil)

Children build their own registry, so without the approver a work-mode subagent would run bash straight past the parent's approval gate.

node_path is this supervisor's own position ("2.1"), which its children extend — an id is then unambiguous across levels. A definition may name a different provider, but building one needs API keys and config that belong in the CLI — so the CLI injects a factory rather than having that logic duplicated here.

Source
run_child(prompt : String, mode : Mode, provider : Smith::LLM::Provider, model : String, definition : Smith::Agents::Definition | Nil = nil) : Report
Source