Skip to content

[Feature]: Claude account pool — per-account pause and per-account auto-switch threshold (parity with Codex) #6013

Closed

Description

@thisisjun786

Summary

The Claude (Anthropic) account pool is missing two per-account controls that the Codex (ChatGPT) account pool already has. Please add them to the Claude pool so both pools can be managed the same way.

Current state (checked in v2.67.0)

Codex pool has:

  • Per-account pause: pausedCodexAccountIds (src/codex/account-pause.ts, isCodexAccountPaused). A paused account is excluded from future pool selection, but its credentials and runtime health stay as they are. It is exposed in the GUI, in the auth API (src/codex/auth-api/routes.ts) and in the CLI (ocx account pause).
  • Per-account auto-switch threshold override: codexAccountAutoSwitchThresholds (src/codex/account-auto-switch.ts). An account with no override inherits the global autoSwitchThreshold.

Claude pool has:

  • Only the pool-wide anthropicAccountPool.autoSwitchThreshold (default 80), plus enable/strategy/stickyLimit/quotaWindow.
  • No way to pause a single Claude account without logging it out or removing it.
  • No per-account threshold. Every Claude account switches at the same usage percentage.

Requested

  1. Pause/resume per Claude account
    • A paused account is skipped by Anthropic pool selection (quota / round-robin / fill-first, failover successors) and keeps its credentials.
    • Available from the GUI account card, the management API and the CLI, as it is for Codex.
    • Suggested storage: pausedAnthropicAccountIds, mirroring pausedCodexAccountIds. When an account is removed, its pause entry is removed too.
  2. Per-account auto-switch threshold for Claude accounts
    • An optional override for each account (0-100). An account with no override inherits anthropicAccountPool.autoSwitchThreshold.
    • All Anthropic usage-driven routing decisions use the effective per-account threshold (anthropic-routing.ts: the usage-score checks, fill-first advance and successor skipping).
    • Editable on the Claude account card, like the Codex one.

Why

With several Claude subscriptions of different sizes (for example Max 20x and Pro), one global threshold is too coarse. Some accounts should be drained further, and some should be kept in reserve at a lower percentage. Pausing is also needed to take an account out of rotation temporarily (to save it for direct use or during an investigation) without losing its login. Codex already supports both, so this would bring the Claude pool to parity with the Codex pool (following #294).

Activity

  1. added
    priority: P2Medium: provider/client-specific bug with a workaround, bounded enhancement tied to a tracked issue,
    on Sep 26, 2026
  2. Ingwannu commented on Sep 26, 2026

    @Ingwannu
    Owner

    Accepted for implementation as a P2 enhancement; no direct duplicate was found. Please split it into two vertical slices so pause semantics land and are reviewable before per-account thresholds:

    1. Manual pause/resume across config, persisted API mutation/DTO, CLI and GUI.
    2. Optional per-account threshold with absent/null inheritance from the Anthropic pool default.

    Important selection boundaries for the first slice: paused accounts must be excluded from future automatic choices in the ordinary eligible roster, affinity/manual/active fast paths, and reactive 429 successors even when anthropicAccountPool.enabled is false. Re-check eligibility after asynchronous credential/pacing waits. Pausing must not erase credentials or health, cancel an already-sent turn, or silently select a paused account through a cached binding; removal must clean up stored pause and threshold entries.

    For thresholds, validate integer 0..100, preserve current unknown-quota/fallback semantics, and define 0 as disabling usage-driven switching for that account rather than treating it as immediately exhausted. Compare source and candidate using each account's effective threshold.

    Likely overlap to coordinate, not duplicates: #5408 touches the same GUI/DTO surface and #5561 touches Anthropic selection. Existing #3375/#3376 are broader epics; #5956 is a separate Codex automatic low-quota policy.

    Regression coverage should include every strategy/window, active and affined accounts, all-paused refusal, pool-disabled 429 failover, pause during an await, resume with credentials/health preserved, inheritance/reset/0/100/invalid thresholds, deletion cleanup, persistence races, and API/CLI/GUI parity.

  3. lidge-jun commented on Sep 27, 2026

    @lidge-jun
    Owner

    Status from release train 4: #6106 (merged to dev as 555ef68ac6) adds manual pause/resume for generic OAuth pools, such as Antigravity, Kiro, xAI and Kimi, across the API, CLI and dashboard. It does not cover the Anthropic pool this issue asks about. Anthropic account selection has its own active-account, affinity, quorum and fill-first paths. Setting the shared paused field without updating each of them would give a partial pause that still routes requests, so the pause route rejects Anthropic for now.

    This stays open for both slices @Ingwannu outlined: an Anthropic pause wired through that selector, then the per-account threshold. The stored field and the API/CLI shapes from #6106 can be reused.

  4. Ingwannu commented on Sep 28, 2026

    @Ingwannu
    Owner

    The first implementation slice is now in draft PR #6204: Anthropic per-account pause/resume across persistence, API/CLI/GUI, model routes, refresh, pacing, and pre-send dispatch. It intentionally does not close this issue; per-account threshold remains the second slice. Exact-head hosted CI is running.

  5. Ingwannu commented on Sep 28, 2026

    @Ingwannu
    Owner

    Both requested vertical slices now have reviewable PRs:

    #6207 must follow #6204; it intentionally targets the first PR branch so reviewers see only the second slice. Keep #6013 open until both land in dev.

  6. lidge-jun commented on Sep 29, 2026

    @lidge-jun
    Owner

    Both slices are on dev: per-account Anthropic pause/resume (#6204) and per-account auto-switch thresholds (#6207), across CLI, management API and dashboard. Pause also stops auxiliary quota and model-discovery sends for a paused account. Ships in the next release; please open a new issue for anything the two slices do not cover.

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 requestpriority: P2Medium: provider/client-specific bug with a workaround, bounded enhancement tied to a tracked issue,

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions