Skip to content

[Feature] Let users define the priority order for automatic account failover in the Codex pool #821

Closed

Description

@whitesarum

Area

Proxy and routing

What are you trying to accomplish?

I want to define the priority order used by the existing automatic account switching behaviour.

OpenCodex already moves to another account when the current one is exhausted or unavailable. I want that automatic failover to follow an order I set (1 → 2 → 3 → 4…), instead of an order chosen by the system.

What prevents this today?

Automatic switching to the next account already exists, but the user cannot control the order of that switching. The pool decides the next account on its own (e.g. by lowest-usage / health heuristics), so I cannot enforce a planned sequence such as “finish account A completely, then move to B, then C…”.

What should OpenCodex do?

Keep the current automatic failover behaviour, but allow the user to attach a priority order to it.

When the current account is exhausted (or becomes unhealthy), OpenCodex should pick the next account according to the user-defined order, not an opaque internal ranking.

Example usage or interface

Current behaviour (simplified):

  • Account A runs out of quota
  • OpenCodex automatically picks some other healthy account (B or C or D…) according to its own logic

Desired behaviour:

  • User sets priority order: A → B → C → D
  • Account A runs out of quota
  • OpenCodex automatically switches to B (the next in the user’s order)
  • Later B is exhausted → automatically switches to C
  • Then D

UI example:

  • Dashboard list with drag-and-drop (or numeric priority)
    1. account-A
    2. account-B
    3. account-C
    4. account-D

The existing “move to next account when exhausted” mechanism stays; only the order becomes user-controlled.

Alternatives or workarounds

Manually disabling higher-priority accounts or constantly monitoring usage and forcing switches by hand. This works but defeats the purpose of having automatic failover.

Additional context

This is not a request for a new “pick next session” button.
It is a request to make the already-existing automatic account transition respect a user-defined priority order.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

  1. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: unknown.

  2. added
    proxyHTTP proxy, routing, reverse-proxy / management auth
    account-poolOAuth, credentials, Codex pool, quota, failover, plans
    on Aug 1, 2026
  3. Ingwannu commented on Aug 1, 2026

    @Ingwannu
    Owner

    This is a useful feature and PR #715 is the active implementation attempt. Its tiering/pin design is substantive, but the current branch is not mergeable as-is: it has multiple merge bases, a large stale GUI surface, and the owner review requires #671 to land first, followed by a rebase and a combined regression proving an exact account selector bypasses priorities/pins without mutating them.

    Keeping this issue open and linked to #715. The PR should not be merged until that dependency/rebase/regression and the requested credential-selection review are complete.

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

    account-poolOAuth, credentials, Codex pool, quota, failover, plansenhancementNew feature or requestproxyHTTP proxy, routing, reverse-proxy / management auth

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions