Repository navigation
Description
Client or integration
Codex CLI (routing through the local proxy; the same proxy path serves Codex App sessions)
Area
Authentication and account pool
Summary
With the Anthropic OAuth account pool enabled, all Claude requests were refused locally with 429 (failureStage=headers-only, 7-9 ms, no upstream attempt) and service.log showed [anthropic-pool] no eligible replacement; returning 429.
All five unpaused accounts were in cooldowns whose deadlines equaled each window reset time. One of them then had its usage counters reset by a plan-tier upgrade: fresh usage observations went from 100/66 percent to 0/0 percent on both windows (verified with ocx account list anthropic --quota --refresh, updatedAt after the reset).
The account stayed out of the pool anyway, because its active cooldown had cooldownSource retry-after and the recovery contract only reconciles reset-derived cooldowns. The pool kept refusing every Claude request until the operator ran ocx account clear-cooldown anthropic <id>.
Expected: once a fresh, complete usage read proves headroom in every window that the refusal reported as rejected, reconcile the cooldown regardless of which deadline source was recorded at refusal time (Retry-After vs reset-derived). A refusal classified shared-quota carries the same evidence in both cases.
Reproduction
- Enable the Anthropic account pool (round-robin, weekly window). Drive accounts to their window limits so 429s are recorded with
anthropic-ratelimit-unified-*-status: rejectedplus aRetry-Afterheader. The cooldown record then uses cooldownSourceretry-afterwith a deadline equal to the window reset. - Before that deadline, make the account usage drop below the limit on every previously rejected window (plan upgrade, a reset grant, or the window rollover).
- Observe:
ocx account list anthropic --json --quotareports fresh fiveHourPercent 0 / weeklyPercent 0, but health staysRate limited, and requests keep failing locally with 429. Onlyocx account clear-cooldown anthropic <id>restores service; it takes effect immediately with no restart.
Step 2 could not be repeated deterministically because the upgrade happened on a live account; the sequence above is what the recorded timestamps and quota observations show.
Version
2.83.0 (@bitkyc08/opencodex, npm global install, bundled Bun runtime)
Operating system
macOS (Apple Silicon), local standalone proxy, port 10100
Provider and model
anthropic / claude-opus-5-5 (the whole Claude family shares this pool)
Logs or error output
[anthropic-pool] 429 on pXXXXXX; failing over to pYYYYYY
[anthropic-pool] no eligible replacement; returning 429
Usage ledger rows for the refusals: status 429, errorCode rate_limit_exceeded, failureStage headers-only, durationMs 7-9.
Account health observed for the affected account: Rate limited, then Rate limited again after a fresh read showed 0/0 usage, then Healthy only after clear-cooldown.
Redacted configuration
{
"anthropicAccountPool": {
"enabled": true,
"autoSwitchThreshold": 99,
"strategy": "round-robin",
"stickyLimit": 1,
"quotaWindow": "weekly"
}
}Source-level analysis (v2.83.0)
src/oauth/anthropic-routing.ts(around line 1092): the cooldown record prefersretry-afterover the reset-derived deadline, andrejectedQuotaWindowsis only attached on the reset-derived branch.src/oauth/anthropic-routing.ts(around line 370):captureAnthropicCooldownRecoveryreturns null unlesscooldownSource === "reset-derived", soprobeAnthropicQuotaWithRecovery/settleAnthropicCooldownRecovery(src/providers/quota/anthropic-cooldown-recovery.ts) can never clear a Retry-After-sourced cooldown, even when the refusal was classifiedshared-quotaand every rejected window now reads below 100 percent.- Suggestion: for
shared-quotarefusals, attachrejectedQuotaWindowsin both branches, and let the existing fresh-probe recovery claim Retry-After cooldowns too (or re-derive the deadline from a fresh read).
Related: #3973 (manual reset credit; here no credit was consumed and the counters were read fresh via the usage probe), #915, #433, #6692.
Activity
docs(providers): translate the Anthropic usage-limit and fresh-read r…
fix(anthropic-pool): answer spent quota as a usage limit and let fres…
docs(providers): translate the Anthropic usage-limit and fresh-read r…
fix(anthropic-pool): answer spent quota as a usage limit and lift Ret…
lidge-jun commentedon Oct 12, 2026
Fixed on
devby #6995 (commitbbe1fc19da), landed through #7009 (merge8f10f238e3). Ships in 2.84.0.fix(anthropic-pool): lift 429 quota cooldowns from a background usage…