[Bug]: Inactive weekly_scoped (Fable) limits are still dropped after #8088, hiding real per-account Fable usage from the pool

Aperta
#8,110 5 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

Start in src/providers/quota/anthropic-usage-windows.ts, especially the anthropicUsageBuckets handling of is_active and already-represented windows. Compare its output with the issue’s Anthropic usage examples, including inactive session, weekly_all, and weekly_scoped rows. Done when all reported quota windows remain available for display and routing without breaking scoped-limit handling; verify with the account quota command and relevant tests.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

account-pool bug
Client or integration

OpenCodex dashboard

Area

Authentication and account pool

Summary

Update: the shared-meter half of this (session / weekly_all) is fixed by #8088, merged to dev after 2.96.0 shipped. #8088 deliberately keeps weekly_scoped (Fable/Opus/Sonnet) rows active-only, and that remaining part is what this issue asks to change: an inactive Fable row still carries real usage (12% and 6% on two of my accounts) and is still hidden from the dashboard and from routing. The original report follows.

After a recent update, the Anthropic account rows on the dashboard (and ocx account list anthropic --quota) show only one quota window per account. The five-hour, weekly and Fable windows are no longer shown together, even though /api/oauth/usage still reports all three with real usage.

The cause is how is_active is read. Anthropic sets is_active: true on the limit that is currently binding for the account (one per account in every response I captured), not on "limits that apply to this account". anthropicUsageBuckets in src/providers/quota/anthropic-usage-windows.ts drops every is_active: false entry (line 40) and, because the window is already marked represented, also skips the legacy five_hour / seven_day duplicate. The non-binding windows therefore disappear.

Expected: all windows that the usage endpoint reports are shown and available to routing; is_active only marks which one is binding. The Claude Code guide says "only active model-specific weekly limits affect that model family", so the inactive filter appears to be meant for scoped family limits, but the code applies it to session and weekly_all as well.

This matters beyond display. Managing a multi-account pool needs every window for every account: with the filter, a Fable-exhausted account hides its 76% weekly usage, and the active account hides its own Fable usage, so the per-account quota the router reads is incomplete.

Reproduction
  1. Enable the Anthropic OAuth account pool with several Max accounts, some of which have exhausted the Fable weekly limit.
  2. Run ocx account list anthropic --quota --refresh --json.
  3. Compare each account's quota with a direct GET https://api.anthropic.com/api/oauth/usage for the same token.

Observed in 2.96.0 (8 accounts): each non-active account returns only one of fiveHourPercent, weeklyPercent, or a Fable customWindows entry. For example, an account whose usage response has session 0%, weekly_all 76% and Fable 100% shows only customWindows: [{label: "Fable", percent: 100}].

Usage-endpoint limits for that account (redacted):

[
  {"kind": "session", "group": "session", "percent": 0, "severity": "normal", "resets_at": null, "scope": null, "is_active": false},
  {"kind": "weekly_all", "group": "weekly", "percent": 76, "severity": "warning", "resets_at": "2026-11-03T11:00:00.301462+00:00", "scope": null, "is_active": false},
  {"kind": "weekly_scoped", "group": "weekly", "percent": 100, "severity": "critical", "resets_at": "2026-11-03T11:00:00.301646+00:00", "scope": {"model": {"id": null, "display_name": "Fable"}, "surface": null}, "is_active": true}
]

The same response also carries "seven_day": {"utilization": 76.0, ...}, which is ignored because weekly_all is already represented.

For the currently active account the binding limit is weekly_all (40%, is_active: true); session (17%) and Fable (12%) are is_active: false. Its dashboard row shows five-hour only because the response headers of served requests fill it in; the Fable 12% is not shown at all.

Local fix that resolves it (verified: all 8 accounts now show five-hour, weekly and Fable after ocx restart):

-    if (row.is_active === false) continue;
-    if (row.is_active !== undefined && row.is_active !== true) { familyEnumeration = false; continue; }
+    if (row.is_active !== undefined && typeof row.is_active !== "boolean") { familyEnumeration = false; continue; }

If routing should still treat a non-binding scoped limit differently, that decision could read is_active from the bucket row instead of dropping the window before display and routing see it.

Version

2.96.0

Operating system

Windows 11

Provider and model

anthropic (OAuth account pool) / claude-fable-5-1

Checks
  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.
Lingua principale
TypeScript
Stelle
16.9k
Fork
1.3k
Merge medio
1g 1h
PR unite (30g)
716

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di lidge-jun/opencodex

Tutte le issue di lidge-jun/opencodex

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.