config

package
v0.3.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package config handles Drover configuration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOperator

func GetOperator() string

GetOperator returns the current operator name from environment or config file

func SetOperator

func SetOperator(name string) error

SetOperator saves the operator name to the config file

Types

type Config

type Config struct {
	// Database connection
	DatabaseURL string

	// Worker settings
	Workers int

	// Task settings
	TaskTimeout     time.Duration
	MaxTaskAttempts int

	// Retry settings
	ClaimTimeout time.Duration
	StallTimeout time.Duration
	PollInterval time.Duration
	AutoUnblock  bool

	// Git settings
	WorktreeDir string

	// Agent settings
	AgentType  string // "claude", "codex", or "amp"
	AgentPath  string // path to agent binary
	ClaudePath string // deprecated: use AgentPath instead

	// Process-isolated worker settings (for OOM prevention)
	UseWorkerSubprocess bool   // use drover-worker for process isolation
	WorkerBinary        string // path to drover-worker binary (default: "drover-worker")
	WorkerMemoryLimit   string // memory limit for worker processes (e.g., "512M", "2G")

	// Backpressure settings (adaptive concurrency control)
	BackpressureEnabled            bool          // enable backpressure control
	BackpressureInitialConcurrency int           // initial concurrency level
	BackpressureMinConcurrency     int           // minimum concurrency
	BackpressureMaxConcurrency     int           // maximum concurrency
	BackpressureRateLimitBackoff   time.Duration // initial backoff on rate limit
	BackpressureMaxBackoff         time.Duration // maximum backoff duration
	BackpressureSlowThreshold      time.Duration // response time considered slow

	// Memory-aware backpressure settings (drover-mem-6)
	BackpressureMemoryAwareEnabled bool  // enable memory-aware spawning
	BackpressureMemoryThresholdMB  int64 // minimum available MB before throttling
	BackpressureMemoryCriticalMB   int64 // critical memory threshold - stop spawning
	BackpressureWorkerRSSLimitMB   int64 // per-worker RSS limit in MB

	// Worker mode settings (for planning/building separation)
	WorkerMode      modes.WorkerMode // "combined", "planning", or "building"
	RequireApproval bool             // require manual approval for plans

	// Beads sync settings
	AutoSyncBeads bool

	// Project directory (detected)
	ProjectDir string

	// Verbose mode for debugging
	Verbose bool

	// Worktree pool settings
	PoolEnabled       bool
	PoolMinSize       int
	PoolMaxSize       int
	PoolWarmup        time.Duration
	PoolCleanupOnExit bool

	// Modes configuration (for planning/building separation)
	Modes *modes.Config

	// Webhook settings
	WebhooksEnabled bool
	WebhookURL      string
	WebhookSecret   string
	WebhookWorkers  int

	// Analytics settings
	AnalyticsEnabled    bool
	AnalyticsConfig     string
	AnalyticsMaxMetrics int

	// File-based task mailbox (drover-mem-4)
	MailboxEnabled           bool   // enable file-based task queue
	MailboxDir               string // directory path for mailbox
	MailboxOutboxRetention   int    // days to keep completed tasks
	MailboxFailedRetention   int    // days to keep failed tasks
	MailboxOrphanScanMinutes int    // minutes between orphan scans
}

Config holds Drover configuration

func Load

func Load() (*Config, error)

Load loads configuration from environment and defaults

func (*Config) CreateAnalyticsManager

func (c *Config) CreateAnalyticsManager() (*analytics.Manager, error)

CreateAnalyticsManager creates and configures an analytics manager from the config

func (*Config) CreateWebhookManager

func (c *Config) CreateWebhookManager() *webhooks.Manager

CreateWebhookManager creates and configures a webhook manager from the config

Jump to

Keyboard shortcuts

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