From b8f29d873d7ab90033c9fa632b6b88dc3e33dcd4 Mon Sep 17 00:00:00 2001 From: Cody Rigney Date: Tue, 2 Dec 2025 16:08:26 -0500 Subject: [PATCH] "Default" profile support for connected clients. --- pkg/client/config.go | 13 ++++++++++--- pkg/client/config_test.go | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pkg/client/config.go b/pkg/client/config.go index dca7e857..99c918ee 100644 --- a/pkg/client/config.go +++ b/pkg/client/config.go @@ -196,20 +196,27 @@ func FindClientsByProfile(ctx context.Context, profileID string) map[string]any continue } clientCfg := processor.ParseConfig() - if clientCfg.WorkingSet == profileID { + if matchesProfile(clientCfg, profileID) { clients[vendor] = clientCfg } } gordonCfg := GetGordonSetup(ctx) - if gordonCfg.WorkingSet == profileID { + if matchesProfile(gordonCfg, profileID) { clients[VendorGordon] = gordonCfg } codexCfg := GetCodexSetup(ctx) - if codexCfg.WorkingSet == profileID { + if matchesProfile(codexCfg, profileID) { clients[VendorCodex] = codexCfg } return clients } + +func matchesProfile(cfg MCPClientCfg, profileID string) bool { + if cfg.IsMCPCatalogConnected && profileID == "default" && cfg.WorkingSet == "" { + return true + } + return cfg.WorkingSet == profileID +} diff --git a/pkg/client/config_test.go b/pkg/client/config_test.go index e13ffbf7..1f935203 100644 --- a/pkg/client/config_test.go +++ b/pkg/client/config_test.go @@ -318,6 +318,18 @@ func TestFindClientsByProfile(t *testing.T) { }, expectedVendors: []string{}, }, + { + name: "find clients with default profile", + profileID: "default", + mockConfigs: map[string][]byte{ + vendorCursor: readTestData(t, "find-profiles/cursor-with-profile.json"), + vendorClaudeDesktop: readTestData(t, "find-profiles/claude-desktop-with-profile.json"), + vendorZed: readTestData(t, "find-profiles/zed-without-profile.json"), + vendorKiro: readTestData(t, "find-profiles/kiro-without-profile.json"), + vendorContinueDev: readTestData(t, "find-profiles/continue-without-profile.yml"), + }, + expectedVendors: []string{vendorZed, vendorKiro, vendorContinueDev}, + }, { name: "finds clients without profile when searching for empty string", profileID: "", @@ -377,6 +389,10 @@ func TestFindClientsByProfile(t *testing.T) { } clientCfg.setParseResult(lists, nil) + if matchesProfile(clientCfg, tc.profileID) { + clientCfg.WorkingSet = tc.profileID // Overwrite if matching + } + shouldMatch := expectedMap[vendor] if shouldMatch {