Repository navigation
[Feature]: Claude account pool — per-account pause and per-account auto-switch threshold (parity with Codex) #6013
Copy link
Copy link
Closed
Labels
account-poolOAuth, credentials, Codex pool, quota, failover, plansOAuth, credentials, Codex pool, quota, failover, plansenhancementNew feature or requestNew feature or requestpriority: P2Medium: provider/client-specific bug with a workaround, bounded enhancement tied to a tracked issue,Medium: provider/client-specific bug with a workaround, bounded enhancement tied to a tracked issue,
Description
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 globalautoSwitchThreshold.
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
- 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, mirroringpausedCodexAccountIds. When an account is removed, its pause entry is removed too.
- 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.
- An optional override for each account (0-100). An account with no override inherits
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).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
account-poolOAuth, credentials, Codex pool, quota, failover, plansOAuth, credentials, Codex pool, quota, failover, plansenhancementNew feature or requestNew feature or requestpriority: P2Medium: provider/client-specific bug with a workaround, bounded enhancement tied to a tracked issue,Medium: provider/client-specific bug with a workaround, bounded enhancement tied to a tracked issue,
Activity
Ingwannu commentedon Sep 26, 2026
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:
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.enabledis 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
0as 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.
lidge-jun commentedon Sep 27, 2026
Status from release train 4: #6106 (merged to
devas555ef68ac6) 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 sharedpausedfield 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.
Ingwannu commentedon Sep 28, 2026
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.
Ingwannu commentedon Sep 28, 2026
Both requested vertical slices now have reviewable PRs:
132770d6145cdc4abadb625cbe840486234126d2) — pause/resume slice, ready, full exact-head hosted CI green.ce65394fcc323f2d79488f13d201f44a6c23d18f) — per-account threshold slice, stacked on feat(oauth): support Anthropic account pause and resume #6204 and now ready for exact-head CI/review. It includes persistence/API/CLI/GUI/docs plus exact selection-generation ownership so policy edits invalidate stale automatic proposals without discarding or resurrecting one-shot manual intent.#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.lidge-jun commentedon Sep 29, 2026
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.