Azure OpenAI: `/model` selector does not preserve Azure deployment names

Open 💬 0 comments Opened Jul 14, 2026 by fabiojmf

What version of Codex CLI is running?

0.144.4

What subscription do you have?

Free

Which model were you using?

Azure OpenAI deployment: gpt-5.6-sol-sejun

What platform is your computer?

Linux

What terminal emulator and version are you using (if applicable)?

Kitty

Codex doctor report

What issue are you seeing?

When using Azure OpenAI with custom deployment names, the /model selector replaces the configured Azure deployment name with the logical model name.

Codex correctly accepts Azure deployment names configured in config.toml. For example, my Azure deployment is named gpt-5.6-sol-sejun, and requests work correctly when this deployment name is configured.

However, after switching models using /model (for example, selecting Terra), Codex changes the model to the logical model name gpt-5.6-terra instead of using the Azure deployment name gpt-5.6-terra-sejun.

The next request fails with:

404 DeploymentNotFound
The API deployment for this resource does not exist.

This appears to happen because the /model selector does not preserve or map Azure deployment names when switching models.

What steps can reproduce the bug?

  1. Configure Codex to use Azure OpenAI with a custom deployment name.

Example:

model_provider = "azure"
model = "gpt-5.6-sol-sejun"

[model_providers.azure]
name = "Azure OpenAI"
base_url = "https://<resource>.cognitiveservices.azure.com/openai"
env_key = "AZURE_OPENAI_API_KEY"
wire_api = "responses"
query_params = { api-version = "2025-04-01-preview" }

  1. Start Codex.
  1. Send a prompt and verify that requests succeed.
  1. Use /model to switch from Sol to Terra.
  1. Observe that Codex changes the model to gpt-5.6-terra instead of the Azure deployment gpt-5.6-terra-sejun.
  1. Send another prompt.
  1. The request fails with:

404 DeploymentNotFound
The API deployment for this resource does not exist.

What is the expected behavior?

When using Azure OpenAI, the /model selector should preserve Azure deployment names or provide a way to map logical model names to Azure deployment names.

For example:

Logical model:
gpt-5.6-terra

Azure deployment:
gpt-5.6-terra-sejun

Selecting "GPT-5.6 Terra" should internally use the configured Azure deployment name instead of replacing it with the logical model name.

This would allow organizations using Azure OpenAI with custom deployment names to use the model selector normally.

Additional information

The Azure deployment works correctly when using the OpenAI Python SDK and explicitly passing the deployment name:

model="gpt-5.6-terra-sejun"

Azure OpenAI deployments are often named differently from the underlying model names because organizations use custom naming conventions.

A deployment alias or model-to-deployment mapping mechanism would solve this while preserving the current model selector experience.

View original on GitHub ↗