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
[Bug]: doctor does not warn when a provider API-key env reference resolves empty #762
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
Configure a key-auth provider such as OpenRouter with authMode: "key" and apiKey: "${OPENROUTER_API_KEY}".
Start OpenCodex without OPENROUTER_API_KEY in the proxy process environment.
Run ocx doctor and observe that it reports no provider credential problem.
Send a routed request through the provider.
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)
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.
changed the title [-]doctor: warn when a provider API-key env reference resolves empty[/-][+][Bug]: doctor does not warn when a provider API-key env reference resolves empty[/+]on Jul 30, 2026
Claim:ocx doctor does not warn when a key-auth provider's apiKey: ""${ENV}"" resolves empty. Checked against: dev@be177ea5
Field
Finding
Still an issue on latest development?
yes
Exact issue
Doctor checks OAuth health, paths, proxy env, memory, startup — not per-provider key/env resolution for authMode: key
Fixed on development?
no
Open PR covering this?
none
Duplicate of?
none
Security relevance
none — diagnostic must never print secret values (reporter already constrains this)
Priority
middle — late failure at inference; doctor is the natural early check
Verdict
Needs fix on development
Evidence:src/cli/doctor.ts has env-reference resolution for proxy config (~310–356) but no analogous provider apiKey walk. Failure mode matches adapter requires a non-empty credential. Gaps: Platform differences for inspecting the service process env vs doctor process env need careful messaging (reporter noted this).
Activity
github-actions commentedon Jul 30, 2026
Issue reopened
The report now contains the information required by the automated check. Thanks for updating it.
github-actions commentedon Jul 30, 2026
Automated translation bookkeeping — detected language: unknown.
[-]doctor: warn when a provider API-key env reference resolves empty[/-][+][Bug]: doctor does not warn when a provider API-key env reference resolves empty[/+]Wibias commentedon Jul 30, 2026
[shipping-github] Research review
Claim:
ocx doctordoes not warn when a key-auth provider'sapiKey: ""${ENV}""resolves empty.Checked against: dev@be177ea5
authMode: keyEvidence:
src/cli/doctor.tshas env-reference resolution for proxy config (~310–356) but no analogous providerapiKeywalk. Failure mode matches adapterrequires a non-empty credential.Gaps: Platform differences for inspecting the service process env vs doctor process env need careful messaging (reporter noted this).
Wibias commentedon Jul 30, 2026
[shipping-github] Opened PR #778 to address this.
Wibias commentedon Jul 31, 2026
Thanks @songwunil — this is fixed by PR #778 by making
ocx doctorwarn when a key-auth provider'sapiKeyenv reference resolves empty.fix: address issue lidge-jun#762
fix: address issue lidge-jun#762