diff --git a/pkg/config/config_old.go b/pkg/config/config_old.go index d2bc27b29..3b62b95ad 100644 --- a/pkg/config/config_old.go +++ b/pkg/config/config_old.go @@ -984,13 +984,20 @@ func (v *skillsGithubConfigV0) ToSkillsGithubConfig() SkillsGithubConfig { } func (v *skillsToolsConfigV0) ToSkillsToolsConfig() SkillsToolsConfig { + cfg := DefaultConfig().Tools.Skills clawHub := v.Registries.ClawHub.ToSkillRegistryConfig() - github := v.Github.ToSkillsGithubConfig() - return SkillsToolsConfig{ - ToolConfig: v.ToolConfig, - Registries: SkillsRegistriesConfig{&clawHub}, - Github: github, - MaxConcurrentSearches: v.MaxConcurrentSearches, - SearchCache: v.SearchCache, + cfg.ToolConfig = v.ToolConfig + cfg.Registries.Set(clawHub.Name, clawHub) + if v.Github.BaseURL != "" { + cfg.Github.BaseURL = v.Github.BaseURL } + if v.Github.Token != "" { + cfg.Github.Token = *NewSecureString(v.Github.Token) + } + if v.Github.Proxy != "" { + cfg.Github.Proxy = v.Github.Proxy + } + cfg.MaxConcurrentSearches = v.MaxConcurrentSearches + cfg.SearchCache = v.SearchCache + return cfg } diff --git a/pkg/config/migration_integration_test.go b/pkg/config/migration_integration_test.go index b180dda90..094c09916 100644 --- a/pkg/config/migration_integration_test.go +++ b/pkg/config/migration_integration_test.go @@ -1118,6 +1118,17 @@ func TestLoadConfig_V0MigrateProducesV2(t *testing.T) { if !modelEnabled("local-model") { t.Error("local-model from V0 should be enabled") } + + githubRegistry, ok := cfg.Tools.Skills.Registries.Get("github") + if !ok { + t.Fatal("expected default github skills registry to survive V0 migration") + } + if !githubRegistry.Enabled { + t.Error("github skills registry should remain enabled after V0 migration") + } + if githubRegistry.BaseURL != "https://github.com" { + t.Errorf("github registry base_url = %q, want %q", githubRegistry.BaseURL, "https://github.com") + } } // TestLoadConfig_UnsupportedVersion verifies that unsupported versions return an error.