Description
The config set command validates provider names, but it does not enforce that the custom provider also has a base URL configured. This makes it easy to save a config that will only fail later at runtime.
Location
src/commands/config.ts:53
src/commands/config.ts:201
Problematic code
if (key === 'provider') {
if (rawValue !== CUSTOM_PROVIDER_KEY && !getProviderInfo(rawValue)) {
throw new Error(`Unknown provider: ${rawValue}.`);
}
return rawValue as ConfigSetValueMap[K];
}
Suggested fix
When setting provider to __custom__, either:
- require
baseUrl to already be present, or
- print a follow-up warning/error until a valid custom endpoint is configured.
Impact
A user can save a configuration that looks valid but cannot create requests.
Description
The
config setcommand validates provider names, but it does not enforce that the custom provider also has a base URL configured. This makes it easy to save a config that will only fail later at runtime.Location
src/commands/config.ts:53src/commands/config.ts:201Problematic code
Suggested fix
When setting
providerto__custom__, either:baseUrlto already be present, orImpact
A user can save a configuration that looks valid but cannot create requests.