taskclass

package
v2.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Debug     = "debug"
	Implement = "implement"
	Chat      = "chat"
	Research  = "research"
	Review    = "review"
)

Canonical task-class names. Use these constants rather than string literals so future class renames are mechanically findable.

View Source
const (
	TierFrontier = "frontier"
	TierMid      = "mid"
	TierSmall    = "small"
)

Tier names mirror pkg/modeltier's TierFrontier / TierMid / TierSmall — duplicated as constants here so taskclass can be referenced without pulling in modeltier when only the labels are needed. Resolution (which provider's model for which tier) lives in ModelForTier below.

View Source
const (
	AskAuto  = "auto"
	AskAsk   = "ask"
	AskAllow = "allow"
)

Ask-mode aliases for the AskMode field. The CLI's --ask flag accepts these strings + "yolo" + "plan" + "acceptEdits"; the ones listed here are the only values task-class profiles actually use.

Variables

This section is empty.

Functions

func Classes

func Classes() []string

Classes returns the canonical task-class names in a stable order suitable for CLI usage messages and validation errors. Order reflects the design doc's table layout (debug, implement, chat, research, review) rather than alphabetical so the most common operator choices appear first.

func ModelForTier

func ModelForTier(provider, tier string) string

ModelForTier returns the default model ID for a (provider, tier) pair. Returns "" when no mapping exists — caller should fall through to whatever model would've been chosen without --task.

Provider names match pkg/models's registration strings ("gemini", "vertex", "anthropic", "anthropic-vertex"). Mock providers (echo, scripted) don't appear here — they have no tier concept.

The table embeds knowledge that also lives in pkg/modeltier's reverse direction (model → tier). When a new model ships, both need bumping. Worth a check at release time; not worth fusing into one table (the two directions have different shape needs: modeltier wants substring matching, taskclass wants canonical-string outputs).

Types

type Profile

type Profile struct {
	// Tier hints which model class to pick. Resolved to a specific
	// model ID per-provider via ModelForTier. Empty = don't change
	// the model.
	Tier string

	// CompactionThreshold goes into the compactor's fallback
	// Threshold field. 0 = leave the substrate default in place.
	// Note: per-tier overrides from config still win for their
	// specific tier (see compactor's resolveThreshold precedence).
	CompactionThreshold float64

	// AgenticToolsEnabled is the desired agentic-tools state. The
	// substrate already defaults to on (PR #118), so today every
	// profile sets this true and the field is mostly informational.
	// Stays as an explicit field so a future "monitor" class that
	// wants agentic-tools off can express that.
	AgenticToolsEnabled bool

	// UseAgenticSmallModel controls whether agentic subtasks route
	// through a cheap-tier model (true) or inherit the parent's
	// model (false). True for tool-heavy task classes; false for
	// chat where subtask overhead doesn't pay off.
	UseAgenticSmallModel bool

	// AskMode is the desired permissions ask-mode default. Empty =
	// don't override the operator / config setting.
	AskMode string
}

Profile is the bundle a task class maps to. Applied to whatever flags the operator left unspecified; explicit flags win. All fields are optional in the sense that an empty / zero value means "don't override the substrate / operator default" — the CLI's resolution logic walks each field independently.

func Resolve

func Resolve(class string) (Profile, bool)

Resolve returns the Profile for class. Empty class returns (Profile{}, false) — caller should not apply anything. Unknown class also returns (Profile{}, false); caller is expected to surface a useful error listing Classes().

Jump to

Keyboard shortcuts

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