Skip to content

The /review command ignores the configured model and endpoint settings, defaulting to gpt-5-codex instead of the specified custom model. #5245

Closed

Description

@Enelass

Environment

Codex Version: 0.46.0
OS: macOS 15.5 (24F74)
Shell: zsh 5.9
LiteLLM Version: 1.72.2

Configuration

~/.codex/config.toml:

model = "gpt-5_custom_model"
model_provider = "litellm"
approval_policy = "on-failure"
sandbox_mode = "danger-full-access"
tools.web_search = true
profile = "gpt5"

[model_providers.litellm]
name = "Chat Completions"
base_url = "https://api.example.com/v1"
env_key = "OPENAI_API_KEY"
wire_api = "chat"

[profiles.gpt5]
model = "gpt-5_custom_model"
model_provider = "litellm"
approval_policy = "on-failure"
request_max_retries = 4
stream_max_retries = 10
stream_idle_timeout_ms = 300000
model_reasoning_effort = "minimal"
model_reasoning_summary = "none"
model_verbosity = "low"
sandbox_mode = "danger-full-access"
tools.web_search = true

Environment Variables:

export OPENAI_API_KEY="$LITELLM_MASTER_KEY"
export OPENAI_API_BASE="https://api.example.com"
export OPENAI_BASE_URL="https://api.example.com"

Issue Description

The /review command ignores the configured model and endpoint settings, defaulting to gpt-5-codex instead of the specified custom model, despite the main interface correctly showing the configured model.

Expected Behavior

  • /review should respect the model configuration from config.toml
  • Should use the configured litellm provider with the custom base URL
  • Should use the model specified in the active profile

Actual Behavior

Codex main interface correctly shows configured model:

╭─────────────────────────────────────────────────────────────────╮
│ >_ OpenAI Codex (v0.46.0)                                       │
│                                                                 │
│ model:     gpt-5_custom_model minimal   /model to change        │
│ directory: ~/Github/project-directory                           │
╰─────────────────────────────────────────────────────────────────╯

But /review command fails with wrong model:

>> Code review started: changes against 'main' <<
stream error: unexpected status 400 Bad Request: {"error":{"message":"{'error': '/chat/completions: Invalid model name passed in model=gpt-5-codex. Call `/v1/models` to view available models for your key.'}","type":"None","param":"None","code":"400"}}; retrying 1/5 in 191ms…
stream error: unexpected status 400 Bad Request: {"error":{"message":"{'error': '/chat/completions: Invalid model name passed in model=gpt-5-codex. Call `/v1/models` to view available models for your key.'}","type":"None","param":"None","code":"400"}}; retrying 2/5 in 376ms…
<< Code review finished >>

Steps to Reproduce

  1. Configure Codex with custom model and LiteLLM provider as shown above
  2. Verify main interface shows correct model configuration
  3. Run /review command on any file
  4. Observe that it attempts to use gpt-5-codex instead of configured model

Additional Context

  • The main Codex interface correctly displays the configured custom model
  • Other commands appear to respect the configuration correctly
  • The issue is specifically with the /review command hardcoding gpt-5-codex
  • Error occurs at the /chat/completions API endpoint level

Additional information

No response

Activity

  1. github-actions commented on Oct 16, 2025

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  2. Enelass commented on Oct 16, 2025

    @Enelass
    Author

    Fixed with review_model in config.toml as per #4788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions