Help us shape the future of Go! Take the 2026 Go Developer Survey

subagent

package
v0.3.65 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSubagent

func NewSubagent(cfg SubagentConfig, deps SubagentDeps) (agentkit.Tool, error)

NewSubagent registers tool/subagent: Delegate a subtask to a child agent (tool name: delegate) and wait for its conclusion.

Best practices:

  • Pair with prompt/section/subagents, which lists the valid agent names; this tool's description is static and cannot.
  • Mount it only on the main agent's tools runtime. The subagent spawner needs a separate runtime without it, both to break a dependency cycle and to keep children from delegating further.
  • Bump toolTimeouts for delegate: a child agent runs many steps and will blow through the default tool timeout.

Types

type SubagentConfig

type SubagentConfig struct {
	// DefaultTimeoutSeconds applies when the model omits timeoutSeconds on delegate.
	DefaultTimeoutSeconds int `json:"defaultTimeoutSeconds,omitempty"`
}

func (*SubagentConfig) SetDefaults added in v0.3.55

func (c *SubagentConfig) SetDefaults()

SetDefaults implements pluginkit.Defaulter.

type SubagentDeps

type SubagentDeps struct {
	Subagent subagent.Spawner `json:"subagent"`
}

type SubagentInput

type SubagentInput struct {
	Agent string `json:"agent" jsonschema:"Name of the subagent to delegate to, from the subagent list in the system prompt"`
	Task  string `` /* 128-byte string literal not displayed */
	Async *bool  `` /* 147-byte string literal not displayed */
	// TimeoutSeconds overrides the spawner wall clock for this call and extends the delegate tool wait when larger than toolTimeouts.
	TimeoutSeconds *int `json:"timeoutSeconds,omitempty" jsonschema:"Wall-clock limit in seconds for this delegation. Default 900 when omitted."`
}

type SubagentOutput

type SubagentOutput struct {
	Agent   string `json:"agent"`
	Status  string `json:"status"`
	Summary string `json:"summary"`
	Session string `json:"session"`
	Steps   int    `json:"steps"`
	JobID   string `json:"jobId,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL