Documentation
¶
Overview ¶
Package subagent is the agent run as a tool of its own: work that would fill this run's context — reading a long file, sweeping a cluster, trying three things to see which holds — is handed to a run that has a context of its own, and comes back as one answer.
Starting one does not wait for it, so several can be in the air at once and the model decides when it wants each answer. What it cannot do is walk away: the agent holds a run open until the subagents it started have finished, so an answer nobody collects is still paid for and still reported. The tool descriptions say so.
The package lives outside core/agent for the same reason core/schedule does: the tools need the agent itself, and the agent depends on the tools.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tools ¶
type Tools struct {
// contains filtered or unexported fields
}
Tools are the subagent tools: start, wait, cancel. Register puts them on the provider and teaches the agent to forget a run's subagents when the run ends — also the last moment one of them can still be running, so nothing here outlives the turn that put it there, and a subagent id from an earlier turn is simply unknown.
func Register ¶
func Register(p *tools.Provider, a *agent.Agent, cfg config.Config, messages *i18n.Bundle, log *slog.Logger) *Tools
Register constructs the subagent tools and registers them. Call it during application setup, before the first Fire; the SUBAGENT scenario excludes them by name, which is the depth cap — a subagent cannot start one of its own.