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

routing

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package routing resolves which model serves each role and task: the main agent, the delegated children (delegate subagents and workers) and, later, auxiliary helper calls. With no models: section and no routing flags every task resolves to the main model.

Index

Constants

View Source
const (
	RoleMain      = "main"
	RoleDelegated = "delegated"
	RoleAuxiliary = "auxiliary"
)

Roles.

View Source
const (
	TaskMain     = "main"
	TaskDelegate = "delegate"
	TaskWorker   = "worker"

	TaskCompaction = "compaction"
	TaskReview     = "review"
)

Tasks.

View Source
const SourceMain = "main model"

SourceMain is the Source of a task that falls back to the main model.

Variables

This section is empty.

Functions

func Info

func Info(routes []Route) map[string]any

Info is the run.started "models" field: each route keyed by task.

Types

type Route

type Route struct {
	Role   string `json:"role"`
	Task   string `json:"task"`
	Model  string `json:"model"`
	Source string `json:"source"` // the flag or config key that chose Model, or SourceMain
	// Fallbacks is the role's fallback chain for Model (models.<role>.
	// fallback_models), empty with --no-fallback.
	Fallbacks []string `json:"fallback_models,omitempty"`
}

Route is the resolved model of one task.

func Auxiliary

func Auxiliary(cfg config.AgentConfig, main, task string) Route

Auxiliary resolves an auxiliary task (TaskCompaction or TaskReview): --route <task>=, then models.auxiliary.tasks.<task>, then --aux-model, then models.auxiliary.model, then the main model.

func Delegated

func Delegated(cfg config.AgentConfig, main, task string) Route

Delegated resolves a delegated task (TaskDelegate or TaskWorker): --route <task>=, then the task override (models.delegated.tasks.<task>, or its alias subagents.model / subagents.workers.model), then --delegate-model, then the role default models.delegated.model, then the main model.

func Main

func Main(spec string) Route

Main returns the main agent's route.

Jump to

Keyboard shortcuts

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