Skip to content

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

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.

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