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

subagent

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package subagent implements sub-agent spawning for the spawn_agent tool. It builds the SubagentDispatcher that is injected into the run context by both the TUI (ui/cmd_handlers.go) and the web handler (web/handlers.go).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDispatcher

func NewDispatcher(
	allAdapters []models.ModelAdapter,
	cfg config.Config,
	mcpDispatchers map[string]tools.MCPDispatcher,
	onEvent func(modelID string, e models.AgentEvent),
) tools.SubagentDispatcher

NewDispatcher returns a SubagentDispatcher that builds and runs sub-agents.

allAdapters is the full list of configured adapters; model routing for spawn_agent's optional model_id arg searches this list.

cfg supplies SubagentModel (default model override) and SubagentMaxDepth (recursion limit; 1 = no recursion by default).

mcpDispatchers is the MCP dispatcher table so sub-agents can call MCP tools.

onEvent routes sub-agent tool events to the parent's UI panel; the modelID string is the sub-agent's model ID (used for panel routing).

Types

This section is empty.

Jump to

Keyboard shortcuts

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