taskclass

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeChat = "Chat"
	ModeTask = "Task"
)

Agent-mode labels returned by AgentMode. String-typed (not ADK types) so taskclass stays a pure-data package — the ADK wiring happens in the caller (internal/compose, cmd/mast).

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

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

Orchestrate is mast-added (the parent project ships five classes): bundles that enable the planner declare task_class: orchestrate, which maps to a planner-enabled Task-mode root (modes.go).

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 AgentMode

func AgentMode(class string) string

AgentMode returns the ADK agent mode a public task class runs under, or "" for an unknown/empty class (caller should surface an error listing Classes rather than guess).

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; orchestrate appends last as the mast-added planner class.

func Instruction

func Instruction(class string) string

Instruction returns the per-class instruction default, or "" when the class has none (unknown classes, and classes whose right default is the generic per-mode fallback). See the precedence note in this file's doc comment: callers pass a non-empty result to the pkg/agent constructor so the class profile beats the generic mode default, and pass "" through so the constructor's own fallback applies.

chat and orchestrate intentionally return "": chat's right framing IS pkg/agent's DefaultChatInstruction, and orchestrate's root is the planner, whose template (pkg/planner DefaultInstructionTemplate) embeds the orchestration frame itself.

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).

func PlannerEnabled

func PlannerEnabled(class string) bool

PlannerEnabled reports whether the class runs with the planner as the root shape (docs/orchestration-design.md: bundles that enable the planner typically declare task_class: orchestrate).

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