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

agentoptions

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfiguredValue

func ConfiguredValue(cfg config.Config, agent string, kind Kind) string

ConfiguredValue returns the configured value for an agent field.

func DiscoverModels added in v0.20.0

func DiscoverModels(agent string, req DiscoveryRequest) ([]string, error)

DiscoverModels queries the harness without sync or inference. It uses the same project environment and provider configuration helpers as launch and dispatch. A returned catalog describes selectable models, not guaranteed account access.

func HasModelDiscovery added in v0.20.0

func HasModelDiscovery(agent string) bool

HasModelDiscovery reports whether the installed harness can supply a catalog.

func ParseModelCommandOutput added in v0.20.0

func ParseModelCommandOutput(agent string, output []byte) ([]string, error)

ParseModelCommandOutput validates native non-protocol model output. Remote executors can transport the bytes without maintaining a second model parser.

func Supports

func Supports(agent string, kind Kind) bool

Supports reports whether an agent exposes the requested option surface.

func Values

func Values(agent string, kind Kind, req DiscoveryRequest) []string

Values returns suggested values for an agent field.

Types

type DiscoveryCleanup added in v1.0.0

type DiscoveryCleanup struct {
	// contains filtered or unexported fields
}

DiscoveryCleanup owns authenticated probes after their catalogs are returned. Its zero value is ready to use. Owners must call Close before process exit.

func (*DiscoveryCleanup) Close added in v1.0.0

func (c *DiscoveryCleanup) Close() error

Close prevents further probes and joins all pending cleanup without a kill deadline. It is safe to call concurrently with discovery registration.

func (*DiscoveryCleanup) Wait added in v1.0.0

func (c *DiscoveryCleanup) Wait(ctx context.Context) error

Wait waits for registered probes to exit before another credential consumer starts. Callers must serialize discovery and launch around this barrier. Shutdown errors are reported once, after every pending probe has finished.

type DiscoveryRequest

type DiscoveryRequest struct {
	Context  context.Context
	Project  *config.ProjectConfig
	Env      []string
	LookPath func(string) (string, error)
	Live     bool
	// ConfigValues selects names accepted by project configuration instead of
	// native CLI override IDs when a provider exposes different namespaces.
	ConfigValues bool
	// Cleanup allows Claude's catalog to return before native shutdown. The
	// owner must join cleanup before exit or another authenticated launch.
	// Nil keeps discovery synchronous, including native shutdown errors.
	Cleanup *DiscoveryCleanup
	// Timeout bounds live discovery. Claude's graceful shutdown may exceed it
	// so an in-flight credential refresh can finish. Zero uses the client default.
	Timeout time.Duration
}

DiscoveryRequest controls live option discovery.

func DefaultDiscoveryRequest

func DefaultDiscoveryRequest() DiscoveryRequest

DefaultDiscoveryRequest enables live option discovery with the current process environment and PATH lookup.

type Kind

type Kind string

Kind identifies a configurable agent option surface.

const (
	// KindModel selects an agent model field.
	KindModel Kind = "model"
	// KindReasoningEffort selects an agent reasoning-effort field.
	KindReasoningEffort Kind = "reasoning_effort"
)

type OptionSet

type OptionSet struct {
	OverrideSupported bool
	Configured        string
	Suggestions       []string
	AllowCustom       bool
	// Source is harness for discovered models, not_requested when skipped,
	// unavailable on discovery failure, and catalog for non-model options only.
	Source         string
	DiscoveryError string
}

OptionSet is the shared option metadata used by wizard and dispatch.

func Resolve

func Resolve(cfg config.Config, agent string, kind Kind, req DiscoveryRequest) OptionSet

Resolve returns the option metadata for an agent field, including live suggestions only from the harness. Model discovery never uses a fallback.

Jump to

Keyboard shortcuts

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