You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Code Quality] refactor: introduce named type LLMProvider string to replace bare string threading through ~8 functions #48439
The LLMProvider concept is threaded through approximately 8 functions as a bare string, including secret selection logic and gateway routing decisions. Using a named type improves type safety, enables exhaustive switch checking, and documents intent at call sites.
Current State
// Currently — bare string driving secret selection and gateway routingfuncselectSecret(providerstring) string { ... }
funcrouteToGateway(providerstring) url.URL { ... }
// EngineConfig.LLMProvider is string
Suggested Changes
Add type LLMProvider string with its constants (likely in pkg/types or pkg/cli)
Update EngineConfig.LLMProvider field from string to LLMProvider
Update the ~8 functions that accept/return provider values
Add a String() string method for logging compatibility
Files Affected
Likely pkg/cli/ or pkg/types/ for the type definition
~8 functions across compiler/gateway/secret-selection code (exact files to be identified at implementation time via grep -r "LLMProvider" --include=*.go)
Success Criteria
type LLMProvider string defined with named constants
EngineConfig.LLMProvider is LLMProvider not string
No bare string arguments for provider values at key routing/selection call sites
Activity