VS Code model picker changes model but keeps custom model_provider
What version of the IDE extension are you using?
26.602.71036
What subscription do you have?
Pro 20x
Which IDE are you using?
VS Code
What platform is your computer?
Linux 7.0.11-200.fc44.x86_64 x86_64 unknown
What issue are you seeing?
The VS Code extension model picker changes only model, but keeps the previous custom model_provider.
I am using a custom Responses-compatible provider in ~/.codex/config.toml:
model = "gpt-oss:120b"
model_provider = "respawn"
model_reasoning_effort = "xhigh"
[model_providers.respawn]
name = "Respawn"
base_url = "http://192.168.1.134:8080/v1"
experimental_bearer_token = "local-dev-key"
wire_api = "responses"
This works with the custom provider. However, if I use the VS Code extension model picker to switch to GPT-5.5, the extension rewrites only:
model = "gpt-5.5"
but leaves:
model_provider = "respawn"
This creates an invalid configuration: the extension then tries to call the custom provider with model = "gpt-5.5" instead of switching back to the built-in OpenAI provider.
What steps can reproduce the bug?
- Configure a custom provider in
~/.codex/config.toml:
model = "gpt-oss:120b"
model_provider = "respawn"
model_reasoning_effort = "xhigh"
[model_providers.respawn]
name = "Respawn"
base_url = "http://192.168.1.134:8080/v1"
experimental_bearer_token = "local-dev-key"
wire_api = "responses"
- Reload VS Code.
- Start a new Codex thread in the VS Code extension.
- Confirm the custom provider/model works.
- Open the model picker under the composer.
- Select
GPT-5.5.
- Inspect
~/.codex/config.toml.
The config becomes:
model = "gpt-5.5"
model_provider = "respawn"
What is the expected behavior?
The model picker should treat model and model_provider as a pair.
Expected behavior could be one of:
- Selecting a built-in OpenAI model such as
GPT-5.5should also setmodel_provider = "openai".
- The picker should expose provider + model together, for example
OpenAI / GPT-5.5andRespawn / gpt-oss:120b.
- Custom provider models should remain selectable in the picker after switching away from them.
At minimum, the extension should not create an invalid mixed config where a built-in OpenAI model is sent to a custom provider.
Additional information
Codex VS Code extension version: 26.602.71036
The CLI/custom provider config itself works. The issue appears specific to the VS Code extension model picker mutating only model while preserving model_provider.
Related issues:
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
This is related to #26472 , but there is an additional custom-provider failure mode here.
If model selection is persisted to config, the extension must update
modelandmodel_provideratomically. Persisting onlymodelcreates an invalid provider/model pair, for example:model = "gpt-5.5"
model_provider = "respawn"
This causes a built-in OpenAI model to be sent to a custom provider.
So #26472 would fix this if model picker changes stop mutating config entirely. If model picker changes continue to be persisted, then the picker needs provider-aware model selection.
I have a similar use case with an OpenAI-compatible custom provider that exposes multiple models behind the same endpoint.
At the moment, I can configure a custom
model_providerand a singlemodelinconfig.toml, but switching to another model requires manually editing the configuration.It would be great if the VS Code model picker supported models exposed by OpenAI-compatible providers, so users could switch between them from the UI just like they can with the built-in provider.
One possible approach would be to discover models from the provider (e.g. via the OpenAI-compatible
/modelsendpoint). Alternatively, allowing providers to optionally declare a list of available models inconfig.tomlwould also solve the problem.I'd be happy to contribute an implementation if this is a direction the team is interested in.