Skip to content

[Bug]: doctor does not warn when a provider API-key env reference resolves empty #762

Description

@songwunil

Client or integration

Codex CLI

Area

CLI

Summary

ocx doctor does not warn when a key-auth provider stores an environment-variable reference that resolves to an empty value. The first actionable signal appears only when an inference request fails. I expected ocx doctor to identify the unresolved credential reference before a routed request reaches the adapter.

Reproduction

  1. Configure a key-auth provider such as OpenRouter with authMode: "key" and apiKey: "${OPENROUTER_API_KEY}".
  2. Start OpenCodex without OPENROUTER_API_KEY in the proxy process environment.
  3. Run ocx doctor and observe that it reports no provider credential problem.
  4. Send a routed request through the provider.
  5. Observe openai-chat requires a non-empty credential (authMode: key).

Version

2.7.43

Operating system

macOS

Provider and model

OpenRouter; any configured routed model

Logs or error output

Provider unreachable: openai-chat requires a non-empty credential (authMode: key)

Screenshots and supporting files

None.

Redacted configuration

{
  "providers": {
    "openrouter": {
      "adapter": "openai-chat",
      "baseUrl": "https://openrouter.ai/api/v1",
      "authMode": "key",
      "apiKey": "${OPENROUTER_API_KEY}"
    }
  }
}

The diagnostic should expose only the provider name, environment-variable name, and presence/resolution state. It must never print or persist the credential value. When proxy-process environment inspection is unsupported on the platform, the result should say that runtime resolution is unverified.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions