@@ -278,13 +278,9 @@ func (c *Config) configureProviders(env env.Env, resolver VariableResolver, know
279 // Make sure the provider ID is set
279 // Make sure the provider ID is set
280 providerConfig.ID = id
280 providerConfig.ID = id
281− if providerConfig.Name == "" {
282− providerConfig.Name = id // Use ID as name if not set
281+ providerConfig.Name = cmp.Or(providerConfig.Name, id) // Use ID as name if not set
284 // default to OpenAI if not set
282 // default to OpenAI if not set
285− if providerConfig.Type == "" {
286− providerConfig.Type = catwalk.TypeOpenAICompat
283+ providerConfig.Type = cmp.Or(providerConfig.Type, catwalk.TypeOpenAICompat)
288 if !slices.Contains(catwalk.KnownProviderTypes(), providerConfig.Type) && providerConfig.Type != hyper.Name {
284 if !slices.Contains(catwalk.KnownProviderTypes(), providerConfig.Type) && providerConfig.Type != hyper.Name {
289 slog.Warn("Skipping custom provider due to unsupported provider type", "provider", id)
285 slog.Warn("Skipping custom provider due to unsupported provider type", "provider", id)
290 c.Providers.Del(id)
286 c.Providers.Del(id)
@@ -412,9 +408,7 @@ func (c *Config) setDefaults(workingDir, dataDir string) {
412 c.Options.Attribution.TrailerStyle = TrailerStyleAssistedBy
408 c.Options.Attribution.TrailerStyle = TrailerStyleAssistedBy
415− if c.Options.InitializeAs == "" {
416− c.Options.InitializeAs = defaultInitializeAs
411+ c.Options.InitializeAs = cmp.Or(c.Options.InitializeAs, defaultInitializeAs)
420// applyLSPDefaults applies default values from powernap to LSP configurations
414// applyLSPDefaults applies default values from powernap to LSP configurations
@@ -445,9 +439,7 @@ func (c *Config) applyLSPDefaults() {
445 if len(cfg.RootMarkers) == 0 {
439 if len(cfg.RootMarkers) == 0 {
446 cfg.RootMarkers = base.RootMarkers
440 cfg.RootMarkers = base.RootMarkers
448− if cfg.Command == "" {
449− cfg.Command = base.Command
442+ cfg.Command = cmp.Or(cfg.Command, base.Command)
451 if len(cfg.Args) == 0 {
443 if len(cfg.Args) == 0 {
452 cfg.Args = base.Args
444 cfg.Args = base.Args