Skip to content

[Config] config set provider __custom__ can save an unusable config without baseUrl #201

Description

@404-Page-Found

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Fields

    No fields configured for Task.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions