diff options
Diffstat (limited to 'internal/config/config.go')
| -rw-r--r-- | internal/config/config.go | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/internal/config/config.go b/internal/config/config.go index b9454d1..9e065b5 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -72,14 +72,26 @@ type RunnersConfig struct { // Anthropic vs. Claude above. Also requires [providers.google].api_key to // be set; Google = true with no configured key has no effect. Google *bool `toml:"google"` + // Groq, OpenRouter, and OpenAI gate NativeRunners registered under agent + // types "groq"/"openrouter"/"openai", all backed by + // internal/provider/openaicompat (they're OpenAI-wire-compatible, so no + // dedicated adapter package is needed — see docs/api-keys-setup.md). + // Each also requires the matching [providers.<name>].api_key to be set; + // true with no configured key has no effect, same as Anthropic/Google. + Groq *bool `toml:"groq"` + OpenRouter *bool `toml:"openrouter"` + OpenAI *bool `toml:"openai"` } -func (r RunnersConfig) ClaudeEnabled() bool { return r.Claude == nil || *r.Claude } -func (r RunnersConfig) GeminiEnabled() bool { return r.Gemini == nil || *r.Gemini } -func (r RunnersConfig) LocalEnabled() bool { return r.Local == nil || *r.Local } -func (r RunnersConfig) ContainerEnabled() bool { return r.Container == nil || *r.Container } -func (r RunnersConfig) AnthropicEnabled() bool { return r.Anthropic == nil || *r.Anthropic } -func (r RunnersConfig) GoogleEnabled() bool { return r.Google == nil || *r.Google } +func (r RunnersConfig) ClaudeEnabled() bool { return r.Claude == nil || *r.Claude } +func (r RunnersConfig) GeminiEnabled() bool { return r.Gemini == nil || *r.Gemini } +func (r RunnersConfig) LocalEnabled() bool { return r.Local == nil || *r.Local } +func (r RunnersConfig) ContainerEnabled() bool { return r.Container == nil || *r.Container } +func (r RunnersConfig) AnthropicEnabled() bool { return r.Anthropic == nil || *r.Anthropic } +func (r RunnersConfig) GoogleEnabled() bool { return r.Google == nil || *r.Google } +func (r RunnersConfig) GroqEnabled() bool { return r.Groq == nil || *r.Groq } +func (r RunnersConfig) OpenRouterEnabled() bool { return r.OpenRouter == nil || *r.OpenRouter } +func (r RunnersConfig) OpenAIEnabled() bool { return r.OpenAI == nil || *r.OpenAI } // ProviderConfig configures a native (or OpenAI-compatible) LLM provider // backend for the multi-provider harness — see docs/api-keys-setup.md. Phase @@ -131,6 +143,10 @@ type Config struct { LocalModel LocalModel `toml:"local_model"` Runners RunnersConfig `toml:"runners"` Budget BudgetConfig `toml:"budget"` + // Scheduler configures internal/scheduler.Scheduler, the retry-then- + // escalate loop for role-typed tasks. Started only by `serve` (the + // one-shot `run` command has no background scheduler). + Scheduler SchedulerConfig `toml:"scheduler"` // Providers configures native/OpenAI-compatible LLM backends by name (see // ProviderConfig). Unused by runner construction in Phase 1. Providers map[string]ProviderConfig `toml:"providers"` @@ -145,6 +161,21 @@ type BudgetConfig struct { Provider5hUSD map[string]float64 `toml:"provider_5h_usd"` } +// SchedulerConfig configures internal/scheduler.Scheduler's poll loop. +type SchedulerConfig struct { + // PollIntervalSeconds is how often the scheduler checks for role-typed + // FAILED tasks to retry or escalate. Defaults to 30 when zero/unset. + PollIntervalSeconds int `toml:"poll_interval_seconds"` +} + +// PollInterval returns the configured poll interval, defaulting to 30s. +func (c SchedulerConfig) PollInterval() time.Duration { + if c.PollIntervalSeconds <= 0 { + return 30 * time.Second + } + return time.Duration(c.PollIntervalSeconds) * time.Second +} + func Default() (*Config, error) { home, err := os.UserHomeDir() if err != nil { |
