Repository navigation
Description
Summary
When Codex requests its hidden internal approval model codex-auto-review, OpenCodex does not recognize it as an OpenAI/Codex model. If defaultProvider is set to a non-OpenAI provider, the router falls through and forwards the model ID unchanged to that provider.
This breaks every operation that requires escalated approval. The approval review fails before the requested command is spawned.
Environment
- OpenCodex: 2.7.42
- Codex runtime: 0.146.0-alpha.3.1
- Platform: macOS
- Canonical
openaiforward provider: enabled defaultProvider: a non-OpenAI provider (reproduced with DeepSeek)- Codex
openai_base_url: OpenCodex local proxy
No credentials or account identifiers are included in this report.
Minimal configuration shape
{
"providers": {
"openai": {
"adapter": "openai-responses",
"authMode": "forward",
"codexAccountMode": "pool"
},
"deepseek": {
"adapter": "openai-chat",
"defaultModel": "deepseek-v4-flash"
}
},
"defaultProvider": "deepseek"
}Steps to reproduce
- Configure the canonical
openaiforward provider and a non-OpenAI provider. - Set the non-OpenAI provider as
defaultProvider. - Route Codex through the OpenCodex proxy.
- Trigger an operation that requires automatic approval review, for example an escalated command that writes Git metadata.
- Codex sends a request whose model is
codex-auto-review.
Actual behavior
OpenCodex routes the request to defaultProvider and preserves the model name:
provider=deepseek
requestedModel=codex-auto-review
model=codex-auto-review
status=400
The upstream provider rejects the unknown model. In this reproduction the sanitized error was:
The supported API model names are deepseek-v4-pro or deepseek-v4-flash,
but you passed codex-auto-review.
The automatic approval review then fails, so the original command is rejected before execution.
Root cause
In src/router.ts, isBareOpenAiFamilyModel() only recognizes bare IDs beginning with gpt-, o1-, o3-, or o4-.
codex-auto-review:
- has no explicit provider namespace;
- is not recognized as an OpenAI-family model;
- normally does not match a configured provider model/default;
- therefore reaches the generic
defaultProviderfallback.
This makes an internal Codex control-plane model depend on the user's ordinary default model provider.
Expected behavior
codex-auto-review should never be routed through the generic defaultProvider fallback.
When the canonical OpenAI/Codex forward provider is enabled, it should be routed there. If that provider is unavailable, OpenCodex should fail closed with a clear routing error instead of forwarding the internal model ID to an unrelated provider.
Suggested fix
Add an explicit internal-model route before the generic provider/default fallback, for example with an exact allowlist:
const CODEX_INTERNAL_OPENAI_MODELS = new Set(["codex-auto-review"]);Then resolve those IDs through the canonical OpenAI/Codex provider, using the same disabled/missing-provider behavior as bare OpenAI-family models.
An exact allowlist is preferable to a broad codex-* prefix because third-party providers may legitimately expose similarly named models.
Suggested regression tests
defaultProvider=deepseek+ enabled canonicalopenai:codex-auto-reviewroutes toopenai.- Canonical
openaimissing or disabled: routing fails closed withNoEnabledOpenAiProviderError. - Unknown non-internal model IDs still use the configured
defaultProvider. - Normal DeepSeek model routing remains unchanged.
Impact
This is not limited to Git. Any command requiring automatic approval review can become impossible to execute, even after the user explicitly approves it, because the reviewer request itself fails before the approval decision is produced.
Activity
github-actions commentedon Jul 28, 2026
Issue closed: use an issue template
Thanks for taking the time to submit this issue. It was closed automatically because it was not opened with a recognized issue template (Bug report, Feature request, Documentation, or Provider compatibility). Freeform and API-opened issues cannot skip this check.
Please edit the issue to add:
[Bug]:and applying thebuglabel alone is not enough without those section headings filled in.See the Contributing guide for details.
Once the report passes the automated checks, it will be reopened automatically unless a maintainer has changed its state.
github-actions commentedon Jul 28, 2026
Automated translation bookkeeping — detected language: English.