summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorPeter Stone <thepeterstone@gmail.com>2026-05-20 19:23:45 +0000
committerPeter Stone <thepeterstone@gmail.com>2026-05-20 19:23:45 +0000
commit4bef835671542d5785c7dc6229662b9d5b0053f8 (patch)
tree1645363944f59831d249f1dc4d14c4be0e1f712d /internal/config/config.go
parentbf5ea107f6aec57c1fc3d094cd42aef239d46f15 (diff)
feat: add [runners] config section to toggle each runner on/off
Adds RunnersConfig{Claude,Gemini,Local,Container *bool} to Config, parsed from a [runners] TOML section. Each field uses the *bool pointer pattern (nil = enabled by default, false = disabled) so existing installs require no config changes. serve.go / run.go now gate each runner registration on the corresponding Enabled() method. The pool's runners map remains the authoritative routing table — absent entries are already skipped by pickAgent and fail-fast in getRunner, so no executor changes are needed. Example: [runners] gemini = false # disable cloud gemini runner local = true # explicit (same as default) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 25187cf..892d3f7 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -45,6 +45,24 @@ func (m LocalModel) UseForElaborate() bool {
return *m.PreferForElaborate
}
+// RunnersConfig controls which agent runners are registered. Each field is a
+// *bool so that nil (absent from TOML) means "enabled by default", while an
+// explicit false disables the runner without affecting others.
+//
+// The local runner also requires LocalModel.Endpoint to be set; setting
+// Local = true without an endpoint has no effect.
+type RunnersConfig struct {
+ Claude *bool `toml:"claude"`
+ Gemini *bool `toml:"gemini"`
+ Local *bool `toml:"local"`
+ Container *bool `toml:"container"`
+}
+
+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 }
+
type Config struct {
DataDir string `toml:"data_dir"`
DBPath string `toml:"-"`
@@ -68,6 +86,7 @@ type Config struct {
VAPIDEmail string `toml:"vapid_email"`
ClaudeConfigDir string `toml:"claude_config_dir"`
LocalModel LocalModel `toml:"local_model"`
+ Runners RunnersConfig `toml:"runners"`
}
func Default() (*Config, error) {