class

Autobot::Agent::SubagentManager

Inherits Reference < Object

Manages background subagent execution.

Subagents are lightweight agent instances that run in background fibers to handle specific tasks. They share the same LLM provider but have isolated context and a focused system prompt.

Constants

LABEL_MAX_LENGTH = 30
Log = ::Log.for("subagent")
MAX_ITERATIONS = 15
TASK_ID_LENGTH = 8

Constructors

new(provider : Providers::Provider, workspace : Path, bus : Bus::MessageBus, model : String | Nil = nil, brave_api_key : String | Nil = nil, exec_timeout : Int32 = 60, exec_deny_patterns : Array(Regex) = Tools::ExecTool::DEFAULT_DENY_PATTERNS, exec_allow_patterns : Array(Regex) = [] of Regex, sandbox_config : String = "auto", rate_limiter : Tools::RateLimiter | Nil = nil, enabled_tools : Array(String) = [] of String, filesystem_roots : Array(String) = [] of String, web_allowed_domains : Array(String) = [] of String)
Source

Instance methods

running_count

Return the number of currently running subagents.

Source
spawn(task : String, label : String | Nil = nil, origin_channel : String = Constants::CHANNEL_CLI, origin_chat_id : String = Constants::DEFAULT_CHAT_ID) : String

Spawn a subagent to execute a task in the background.

Source

Nested types