diff --git a/internal/app/controlplane/curators.go b/internal/app/controlplane/curators.go index 24ed96d2d..1cc84bac0 100644 --- a/internal/app/controlplane/curators.go +++ b/internal/app/controlplane/curators.go @@ -40,7 +40,7 @@ func curatorDefinition() Definition { } func CuratorDefinition(def config.CuratorDefinition) curator.Definition { - return curator.Definition{Name: def.Name, Enabled: def.Enabled, Instructions: def.Instructions, Manifest: curator.Manifest{ + return curator.Definition{Name: def.Name, Enabled: def.Enabled == nil || *def.Enabled, Instructions: def.Instructions, Manifest: curator.Manifest{ Interval: def.Interval.Std(), Cooldown: def.Cooldown.Std(), OnInput: def.OnInput, Tools: def.Tools, Skills: def.Skills, MemoryEngine: def.MemoryEngine, Conversations: def.Conversations, Model: def.Model, }} } diff --git a/internal/config/curator.go b/internal/config/curator.go index 69a8faad4..1dcbbacf1 100644 --- a/internal/config/curator.go +++ b/internal/config/curator.go @@ -1,9 +1,10 @@ package config -// CuratorDefinition is one [[curators]] entry. Interval is required. +// CuratorDefinition is one [[curators]] entry. Interval is required. An entry +// that omits enabled is on: writing one down is the intent to run it. type CuratorDefinition struct { Name string `toml:"name" yaml:"name" json:"name"` - Enabled bool `toml:"enabled" yaml:"enabled" json:"enabled"` + Enabled *bool `toml:"enabled" yaml:"enabled" json:"enabled"` Instructions string `toml:"instructions" yaml:"instructions" json:"instructions"` Interval Duration `toml:"interval" yaml:"interval" json:"interval"` diff --git a/internal/infrastructure/configuration/defaults.go b/internal/infrastructure/configuration/defaults.go index 5742dff99..9d42d6da4 100644 --- a/internal/infrastructure/configuration/defaults.go +++ b/internal/infrastructure/configuration/defaults.go @@ -68,6 +68,18 @@ func (l *Loader) applyDefaults(cfg *config.Config) { applyCaptureDefaults(cfg) applyNATSDefaults(cfg) applyMemoryDefaults(cfg) + applyCuratorDefaults(cfg) +} + +// applyCuratorDefaults resolves an omitted enabled key to on, so the seeded +// resource and the dashboard show the state the runtime applies. +func applyCuratorDefaults(cfg *config.Config) { + for i := range cfg.Curators { + if cfg.Curators[i].Enabled == nil { + on := true + cfg.Curators[i].Enabled = &on + } + } } // applyServiceDefaults fills each registered service's absent addresses from