Repository navigation
Normalize codex-cli helper/embedded Codex resolution to openai-codex - #38215
huangyongde wants to merge 5 commits into
Conversation
Greptile SummaryThis PR normalizes Key Changes:
Confidence Score: 5/5
Last reviewed commit: 8693611 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8693611b39
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if (normalized === "codex-cli") { | ||
| return "openai-codex"; |
There was a problem hiding this comment.
Honor openai-codex auth order for codex-cli lookups
Mapping codex-cli to openai-codex in normalizeProviderIdForAuth makes resolveAuthProfileOrder pull the same credentials, but explicit ordering is still read via findNormalizedProviderValue(..., providerKey) where providerKey stays codex-cli (see resolveAuthProfileOrder), so auth.order["openai-codex"] is ignored for codex-cli runs. In setups with multiple Codex profiles, this can select a different key than the user-configured priority and cause avoidable auth/rate-limit failures.
Useful? React with 👍 / 👎.
20f6bcf to
0b01b81
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b01b81253
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| modelRegistry: ModelRegistry, | ||
| ): Model<Api> | undefined { | ||
| const normalizedProvider = normalizeProviderId(provider); | ||
| const registryProvider = normalizedProvider === "codex-cli" ? "openai-codex" : normalizedProvider; |
There was a problem hiding this comment.
Apply openai-codex overrides to codex-cli forward-compat
Mapping codex-cli to openai-codex here changes the resolved model provider, but resolveModelWithRegistry still fetches provider config from the original request provider (src/agents/pi-embedded-runner/model.ts:109) before applying forward-compat. In practice, codex-cli/gpt-5.4 and codex-cli/gpt-5.3-codex now run as openai-codex without applying models.providers.openai-codex overrides (for example custom baseUrl/headers), so deployments that route Codex traffic through a proxy can silently fall back to the default ChatGPT endpoint.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d070599b45
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if (normalized === "codex-cli") { | ||
| return "openai-codex"; | ||
| } |
There was a problem hiding this comment.
Keep user-pinned codex-cli auth profiles locked
By mapping codex-cli to openai-codex in auth normalization, resolveAuthProfileOrder can now return OpenAI Codex profiles for codex-cli runs, but the lock gate in src/agents/pi-embedded-runner/run.ts still validates user-pinned profiles with normalizeProviderId (exact provider family), so authProfileIdSource: "user" is silently unset for openai-codex:* profiles on codex-cli. In that case an expired/invalid pinned profile no longer hard-fails as a user lock and the runner can rotate to a different profile, which breaks explicit profile selection semantics.
Useful? React with 👍 / 👎.
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing this as implemented after Codex review. Current main already subsumes this PR with a broader manifest-backed What I checked:
So I’m closing this as already implemented rather than keeping a duplicate issue open. Review notes: reviewed against 017252e4f8e7; fix evidence: commit 017252e4f8e7. |
Summary
This patch fixes an inconsistency where helper / embedded paths still treated
codex-clias a separate provider for Codex model resolution and auth lookup, even though the same Codex-backed models already work through theopenai-codexpath.Fixes #38212.
Changes
codex-cliforgpt-5.4andgpt-5.3-codex.openai-codextemplate metadata whencodex-clienters the embedded resolver.codex-clitoopenai-codexfor auth profile lookup.codex-cli/gpt-5.4andcodex-cli/gpt-5.3-codexto xhigh-capable model refs.Why
Before this change:
openai-codex/gpt-5.4had forward-compat supportcodex-cli/gpt-5.4could still fail in helper / embedded pathscodex-clidid not reuse existingopenai-codexOAuth credentialsThe fix makes
codex-cliconsistent with the Codex OAuth-backed provider in the internal helper / embedded path, without changing top-level model-ref syntax.Validation
Ran targeted tests:
Result:
Notes
This is intentionally scoped to internal helper / embedded compatibility for Codex-backed refs and does not change the user-facing
codex-cli/...configuration syntax.