Skip to content

Feature Request: Provider Management, GUI Selection, and Automatic Failover #45839

Open

Description

@Yui100901

What variant of Codex are you using?

App,IDE Extension

What feature would you like to see?

Feature Request: Provider Management, GUI Selection, and Automatic Failover

Summary

I would like to propose a more complete model provider management experience for Codex Desktop and IDE extensions.

Codex already has the concept of model_provider and supports custom providers through configuration. It would be useful to expose this capability through the GUI while also providing an advanced configuration mechanism for users who need multiple providers for the same model.

The feature could consist of two related parts:

  1. GUI provider/model selection
  2. Advanced provider routing and automatic failover

1. GUI model provider selection

The model picker in Codex Desktop / IDE extensions could expose both the provider and model.

For example:

Provider: [ OpenAI ▼ ]
Model:    [ GPT-5 ▼ ]

or:

OpenAI / GPT-5
Azure OpenAI / GPT-5
Provider A / GPT-5
Provider B / GPT-5

Users should be able to see which provider is being used by the current session.

Custom providers defined in config.toml should ideally also appear in the GUI model picker.


2. Advanced provider configuration

For advanced users, providers could continue to be configured through config.toml.

For example:

[model_providers.provider-a]
name = "Provider A"
base_url = "https://provider-a.example.com/v1"
env_key = "PROVIDER_A_API_KEY"

[model_providers.provider-b]
name = "Provider B"
base_url = "https://provider-b.example.com/v1"
env_key = "PROVIDER_B_API_KEY"

The GUI would then automatically discover these configured providers.

This would allow the GUI to remain simple for normal users while configuration files provide more advanced routing capabilities.


3. Automatic failover for the same model

A particularly useful advanced feature would be allowing multiple providers to serve the same logical model.

For example, both providers may expose gpt-5:

provider-a → gpt-5
provider-b → gpt-5

The user could configure a fallback order:

[model_routes.gpt-5]
providers = [
    "provider-a",
    "provider-b",
]

The first provider would be preferred:

gpt-5
   │
   ▼
provider-a
   │
   ├── available → continue
   │
   └── unavailable
          │
          ▼
      provider-b
          │
          └── continue

This would allow Codex to automatically retry the request through provider-b when provider-a is temporarily unavailable.


4. Distinguish model identity from provider

I think it would be useful for Codex to treat these as separate concepts:

Logical Model
     │
     ├── Provider A / gpt-5
     ├── Provider B / gpt-5
     └── Provider C / gpt-5

rather than treating every provider/model combination as an entirely separate model.

This would make provider routing and failover much easier to reason about.

For example, the user could simply select:

Model: GPT-5

while Codex internally applies:

GPT-5
  → Provider A
  → Provider B (fallback)
  → Provider C (fallback)

5. Failure conditions

The failover mechanism could distinguish between different types of errors.

For example, automatic failover could potentially apply to transient errors such as:

  • connection failures
  • timeouts
  • HTTP 429 / rate limiting
  • temporary service unavailability
  • HTTP 5xx errors

While errors such as invalid API keys, invalid model names, or malformed requests might require different handling rather than immediately retrying with another provider.

The exact retry/failover policy could be configurable.

For example:

[model_routes.gpt-5]
providers = ["provider-a", "provider-b"]
max_retries = 1
failover_on = ["timeout", "429", "5xx"]

6. Optional load balancing

Once provider routing exists, a future extension could support load balancing in addition to simple priority-based failover.

For example:

[model_routes.gpt-5]
strategy = "priority"
providers = ["provider-a", "provider-b"]

or:

[model_routes.gpt-5]
strategy = "round_robin"
providers = ["provider-a", "provider-b"]

Potentially other strategies could be added later, such as latency-based or health-based routing.

This does not need to be part of the initial implementation. Priority-based failover alone would already be very useful.


7. GUI representation

The GUI could expose the simple case while keeping advanced routing in settings.

For example:

Model
┌─────────────────────────────┐
│ GPT-5                    ▼  │
└─────────────────────────────┘

Provider
┌─────────────────────────────┐
│ Automatic               ▼  │
└─────────────────────────────┘

With an advanced configuration such as:

GPT-5 routing

Primary:
  Provider A

Fallback:
  Provider B
  Provider C

Strategy:
  Priority / Failover

The normal user would not need to understand provider routing, while advanced users could configure it explicitly.


Why this would be useful

This would be particularly useful for users who:

  • use multiple OpenAI-compatible providers
  • have both primary and backup API endpoints
  • use organizational API gateways
  • need redundancy for long-running coding sessions
  • have different providers with different availability or rate limits
  • want to switch providers without manually editing configuration files

It would also make Codex more resilient when a provider experiences a temporary outage or rate limit.

The important distinction is that the user is still selecting the same logical model, while Codex handles provider selection and failover underneath.


Proposed scope

A possible implementation could be incremental:

Phase 1

GUI support for:

Provider → Model

including custom providers defined in configuration.

Phase 2

Configuration-based provider routing:

logical model → ordered providers

Phase 3

Automatic failover:

Provider A
    ↓ failure
Provider B
    ↓ failure
Provider C

Future

Load balancing, health checks, latency-aware routing, provider-specific retry policies, etc.

This would provide a useful advanced provider-management layer without making the normal Codex experience more complicated.

Additional information

No response

Activity

  1. added
    enhancement
    on Sep 16, 2026
  2. added
    app
    custom-model
    config
    connectivity
    on Sep 16, 2026
  3. pchuri commented on Oct 11, 2026

    @pchuri
    Contributor

    I’d also like this in the Codex CLI, through /model.

    My use case is choosing between the same model accessed through my personal ChatGPT subscription and through an API gateway. For example:

    Personal ChatGPT / GPT-6
    Gateway / GPT-6
    

    Selecting an entry should switch both the model and its connection, including the endpoint and authentication, and clearly show which connection is active. Ideally, this would take effect on the next turn without restarting Codex with a different --profile.

    Manual selection would be enough for my use case; automatic failover isn’t necessary. Exposing the same capability through the app-server API would also let other frontends offer a consistent selector.

  4. zz-zhi54 commented on Nov 17, 2026

    @zz-zhi54

    I'd really love to see native Provider + Model selection in the Codex Desktop model picker. The experience I want is simple: stay in the same Desktop window, select a ChatGPT/OpenAI model or a third-party model, then switch back whenever needed. The UI should clearly show the selected provider and use the corresponding endpoint and credentials.

    This needs to be more than registering multiple providers in config.toml: it should work from the actual Desktop picker, without repeatedly editing configuration, using CLI overrides, restarting, or sending native OpenAI requests through a third-party proxy. Official ChatGPT access and automatic approvals should remain unaffected by optional third-party integrations.

    I'd welcome same-conversation switching if it can be implemented safely; at minimum, both providers should be fully usable through the same Desktop interface. Automatic failover and load balancing are not necessary for this request.

    I've recently spent more time exploring Codex and its open-source code, and the progress on multi-agent collaboration is genuinely exciting. I believe a first-class multi-provider picker would be useful to a growing number of developers experimenting with different models. This feature is very important to me, and I'd love to see it prioritized.

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

    appconfigconnectivitycustom-modelenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions