Problem
Two methods in ClustersClient.ts use credentialId as a parameter name for what is semantically a clusterId — the stable cluster identifier used for cache lookups:
exists(credentialId: string) — line 431
deleteClient(credentialId: string) — line 445
This is inconsistent with:
- The Cluster ID Architecture documented in
copilot-instructions.md which marks clusterId as the correct stable key for CredentialCache and ClustersClient
- Other
ClustersClient methods: getClient(clusterId), getExistingClient(clusterId)
- All methods in
CredentialCache.ts which consistently use clusterId
Investigation
CredentialCache.ts: All 10+ methods use clusterId consistently ✅
ClustersClient.ts: 2 of 4 methods use credentialId ❌, 2 use clusterId ✅
The inconsistency appears to be a naming oversight — functionally, both parameters are used as keys into the same _clients Map which is keyed by clusterId.
Recommendation
Rename the parameter from credentialId to clusterId in both methods. This is a purely cosmetic rename with no functional impact but improves code clarity and alignment with the documented architecture.
Context
Identified during PR #508 review (Finding M10).
Problem
Two methods in
ClustersClient.tsusecredentialIdas a parameter name for what is semantically aclusterId— the stable cluster identifier used for cache lookups:exists(credentialId: string)— line 431deleteClient(credentialId: string)— line 445This is inconsistent with:
copilot-instructions.mdwhich marksclusterIdas the correct stable key forCredentialCacheandClustersClientClustersClientmethods:getClient(clusterId),getExistingClient(clusterId)CredentialCache.tswhich consistently useclusterIdInvestigation
CredentialCache.ts: All 10+ methods useclusterIdconsistently ✅ClustersClient.ts: 2 of 4 methods usecredentialId❌, 2 useclusterId✅The inconsistency appears to be a naming oversight — functionally, both parameters are used as keys into the same
_clientsMap which is keyed byclusterId.Recommendation
Rename the parameter from
credentialIdtoclusterIdin both methods. This is a purely cosmetic rename with no functional impact but improves code clarity and alignment with the documented architecture.Context
Identified during PR #508 review (Finding M10).