fix(codex/azure): remove conflicting requires_openai_auth from Azure preset#2738
fix(codex/azure): remove conflicting requires_openai_auth from Azure preset#2738wh9204 wants to merge 1 commit into
Conversation
…preset The Azure OpenAI preset shipped both `env_key = "OPENAI_API_KEY"` and `requires_openai_auth = true`, which are mutually exclusive auth mechanisms per the Codex config reference: https://developers.openai.com/codex/config-reference > Do not combine with `env_key`, `experimental_bearer_token`, or > `requires_openai_auth`. With both set, Codex ignores the env-key path and demands an OpenAI OAuth login, so users following the README and setting `OPENAI_API_KEY` still see `Missing environment variable: OPENAI_API_KEY.` Azure OpenAI authenticates via API key (env_key), not OpenAI OAuth, so remove the conflicting line. The generated config now matches the canonical Microsoft Learn Azure setup.
|
Claude finished @farion1231's task in 36s —— View job ReviewLGTM. No blocking issues. The fix is correctly scoped. Per the Codex config reference,
The generated TOML now matches the Microsoft Learn canonical Azure setup cited in the PR description. Tasks
|
|
Codex Review: Didn't find any major issues. What shall we delve into next? ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
The Azure OpenAI preset in
codexProviderPresets.tsships with both:env_key = "OPENAI_API_KEY"(env-variable auth)requires_openai_auth = true(OpenAI OAuth login)These two fields are mutually exclusive per the Codex config reference:
When a user follows the README and sets
OPENAI_API_KEY, Codex still errors out withMissing environment variable: OPENAI_API_KEY.— becauserequires_openai_auth = truemakes Codex demand an OpenAI OAuth login flow and ignore the env-key auth path.Fix
Remove the conflicting
requires_openai_auth = trueline from the Azure preset. Azure OpenAI authenticates via API key (env_key), not OpenAI OAuth.Verification
OPENAI_API_KEYenv var and runningcodexconnects to Azure OpenAI successfully (reproduced on Windows 10, Codex v0.130.0, modelgpt-5.5).Scope
Intentionally minimal — only the Azure preset is touched. Some third-party presets generated by
generateThirdPartyConfig()may have the same conflict, but each needs case-by-case verification and is out of scope for this fix.Related: #1309 (broader Azure compatibility PR, but does not modify this file).