Summary
In Codex CLI v0.142.2 on Windows, the /model menu does not appear to handle custom provider models in a v2 profile. When launched with a custom provider profile, opening /model only shows OpenAI models. Selecting one overwrites the profile file with an OpenAI model name while keeping the custom model_provider, making the profile invalid/unusable until it is manually edited again.
Environment
- Codex CLI: v0.142.2
- OS: Windows
- Profile command:
codex --profile thirdparty
- Base config:
C:\Users\33702\.codex\config.toml
- Profile config:
C:\Users\33702\.codex\thirdparty.config.toml
Relevant configuration
Base config contains the custom provider:
[model_providers.thirdparty]
name = "Third Party"
base_url = "https://new-api.jointpilot.com/v1"
env_key = "THIRDPARTY_API_KEY"
wire_api = "responses"
Profile config initially contains:
model_provider = "thirdparty"
model = "kimi-k3"
Steps to reproduce
- Configure the custom provider in
~/.codex/config.toml.
- Configure a v2 profile in
~/.codex/thirdparty.config.toml:
model_provider = "thirdparty"
model = "kimi-k3"
- Launch Codex:
codex --profile thirdparty
- Open the
/model menu.
- Select/confirm one of the listed models.
Actual behavior
The /model menu only shows OpenAI models such as gpt-5.5, gpt-5.4, etc. After selecting one, thirdparty.config.toml is rewritten to something like:
model_provider = "thirdparty"
model = "gpt-5.5"
model_reasoning_effort = "xhigh"
[tui.model_availability_nux]
"gpt-5.5" = 3
This leaves model_provider = "thirdparty" but changes the model to an OpenAI model name, so the custom provider profile no longer points to the intended third-party model.
Expected behavior
Either:
/model should preserve custom provider models and include the current custom model, or
/model should not overwrite a custom-provider profile with an OpenAI model, or
- Codex should clearly warn that the model picker only supports OpenAI models and will modify the active profile file.
Workaround
Manually restore ~/.codex/thirdparty.config.toml to:
model_provider = "thirdparty"
model = "kimi-k3"
Then launch again with:
codex --profile thirdparty
Avoid using /model while using the custom provider profile.
Summary
In Codex CLI v0.142.2 on Windows, the
/modelmenu does not appear to handle custom provider models in a v2 profile. When launched with a custom provider profile, opening/modelonly shows OpenAI models. Selecting one overwrites the profile file with an OpenAI model name while keeping the custommodel_provider, making the profile invalid/unusable until it is manually edited again.Environment
codex --profile thirdpartyC:\Users\33702\.codex\config.tomlC:\Users\33702\.codex\thirdparty.config.tomlRelevant configuration
Base config contains the custom provider:
Profile config initially contains:
Steps to reproduce
~/.codex/config.toml.~/.codex/thirdparty.config.toml:codex --profile thirdparty/modelmenu.Actual behavior
The
/modelmenu only shows OpenAI models such asgpt-5.5,gpt-5.4, etc. After selecting one,thirdparty.config.tomlis rewritten to something like:This leaves
model_provider = "thirdparty"but changes the model to an OpenAI model name, so the custom provider profile no longer points to the intended third-party model.Expected behavior
Either:
/modelshould preserve custom provider models and include the current custom model, or/modelshould not overwrite a custom-provider profile with an OpenAI model, orWorkaround
Manually restore
~/.codex/thirdparty.config.tomlto:Then launch again with:
codex --profile thirdpartyAvoid using
/modelwhile using the custom provider profile.