Bug: auto-review uses hardcoded model name "codex-auto-review", incompatible with custom providers
Environment
- Codex Version: Codex Desktop (macOS)
- Provider: Custom model provider (DeepSeek v4),
base_url = "http://localhost:3000/v1"
Configuration (config.toml)
model_provider = "custom"
model = "deepseek-v4-pro"
[model_providers.custom]
name = "custom"
wire_api = "responses"
requires_openai_auth = true
base_url = "http://localhost:3000/v1"
Issue Description
When using a custom model provider (e.g., DeepSeek), Codex's sandbox auto-review feature sends requests to the configured base_url, but the model field in the request is hardcoded as "codex-auto-review" instead of using the model name configured in config.toml.
Since custom providers (e.g., DeepSeek API) only recognize deepseek-v4-pro / deepseek-v4-flash, the request is rejected:
"error":{"message":"The supported API model names are deepseek-v4-pro or deepseek-v4-flash,
but you passed codex-auto-review.","type":"invalid_request_error"}
Impact
All require_escalated sandbox commands (e.g., git clone, network requests, etc.) fail to pass auto-review, even when the commands themselves are safe.
Expected Behavior
The auto-review feature should use the model name configured by the user (the model field in config.toml), or allow users to separately specify which model auto-review should use in the configuration.
Workaround
Insert a middleware proxy in front of the Codex internal proxy (ccx-darwi:3000) to map codex-auto-review to the user-configured model name.
6 Comments
I'd like to work on this. The root cause is a hardcoded model name string used in the auto-review request path — I'll trace the exact location and propose a fix that falls back to the user-configured model name.
Will share full analysis shortly. Happy to submit a PR if the team would like me to implement this.
Root cause & fix
Root cause
In
codex-rs/core/src/guardian/review.rs, the functionrun_guardian_review_sessionsources the model ID exclusively fromturn.provider.approval_review_preferred_model(), which returns the compile-time constant"codex-auto-review"(defined incodex-rs/model-provider/src/provider.rs). The user's configuredmodelfield is never consulted for auto-review requests.Fix
Check
turn.config.review_modelfirst (anOption<String>from the loaded config), and fall back to the provider default only when it's not set:This allows users to either:
review_model = "deepseek-v4-pro"inconfig.tomlto explicitly control the auto-review model, orMy fork branch with the implementation:
fix/24879-auto-review-model-nameHappy to submit a PR if the team would like me to implement this.
same
+1
+1
+1 This is dumb, why force user into a costly model just for command review without giving the option to a smaller variant or custom model ?