Enable bundled OpenRouter configuration by default

This commit is contained in:
2026-11-03 15:30:47 +00:00
parent 2c50eca033
commit 6f57f2f30a
7 changed files with 155 additions and 9 deletions

View File

@@ -41,13 +41,17 @@ type ConfigurationSources struct {
// Options collects construction choices from the public facade.
type Options struct {
llmClient llm.Client
artifactReader artifact.Reader
validator validate.Validator
validatorSource bool
artifactSource bool
llmClient llm.Client
artifactReader artifact.Reader
validator validate.Validator
validatorSource bool
artifactSource bool
disableBundledOpenRouter bool
}
// SetBundledOpenRouter selects whether the built-in OpenRouter source is installed.
func (o *Options) SetBundledOpenRouter(enabled bool) { o.disableBundledOpenRouter = !enabled }
// SetLLMClient selects the client collaborator for one engine.
func (o *Options) SetLLMClient(client llm.Client) { o.llmClient = client }
@@ -124,6 +128,11 @@ func New(cfg Config, options Options) (*Engine, error) {
return nil, err
}
underlays := cfg.Sources.Underlays
if !options.disableBundledOpenRouter {
underlays = make([]configkit.Underlay, 1, len(cfg.Sources.Underlays)+1)
underlays[0] = configuration.BundledOpenRouterUnderlay()
underlays = append(underlays, cfg.Sources.Underlays...)
}
main := configkit.Input{Source: configkit.NoSource()}
if cfg.Sources.Main != nil {
main = *cfg.Sources.Main