VS Code model picker changes model but keeps custom model_provider

Open 💬 3 comments Opened Jun 11, 2026 by robertomanfreda
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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?

  1. 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"
  1. Reload VS Code.
  1. Start a new Codex thread in the VS Code extension.
  1. Confirm the custom provider/model works.
  1. Open the model picker under the composer.
  1. Select GPT-5.5.
  1. 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:

  1. Selecting a built-in OpenAI model such as GPT-5.5 should also set model_provider = "openai".
  1. The picker should expose provider + model together, for example OpenAI / GPT-5.5 and Respawn / gpt-oss:120b.
  1. 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:

View original on GitHub ↗

3 Comments

github-actions[bot] contributor · 2 months ago

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

  • #26472

Powered by Codex Action

robertomanfreda · 2 months ago
Potential duplicates detected. Please review them and close your issue if it is a duplicate. * Model selection should not be persisted to config #26472 _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 model and model_provider atomically. Persisting only model creates 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.

dhcsousa · 23 days ago

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_provider and a single model in config.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 /models endpoint). Alternatively, allowing providers to optionally declare a list of available models in config.toml would also solve the problem.

I'd be happy to contribute an implementation if this is a direction the team is interested in.