Repository navigation
Description
Summary
Account Pooler never clears its stored 5-hour window. It just keeps whatever values it saw last. On my pool this goes wrong in two cases:
- The account has no 5-hour limit.
/api/oauth/usagereturnsfive_hour: nullfor two of my Max 20x accounts, so they no longer report a 5-hour limit at all. The pool keeps the last 5-hour utilization, reset and status it ever saw, and Settings → Account Pooler still draws a 5H bar for an account that has no such limit. - No 5-hour window is running. For idle accounts the endpoint returns
five_hour: { utilization: 0, resets_at: null }. The pool keeps the previous reset time, which can be days in the past.
I expected the pool to store "no 5-hour limit" or "no window running" and to show that, not the last observation.
Versions and environment
- bb 0.48.1 (npm
bb-app, systemd user service), Debian 13, Node v24.22.1; built-in Account Pooler with 8 Claude OAuth accounts. - The installed bundle (
server/dist/builtin-plugins/account-pool/dist/server.js) has the same logic asmainata0f291b8084ed69aacfc00dc1492a53da30618ad:fiveHourUtilization:c?.utilization??A.fiveHourUtilization,fiveHourResetAt:c?.resetAt??A.fiveHourResetAt,fiveHourStatus:c?.status??….
Steps to reproduce
This was observed on live accounts. Whether an account has a 5-hour limit is decided by Anthropic, so I can't toggle it on demand.
- Have a pooled Claude account whose
GET https://api.anthropic.com/api/oauth/usage(withanthropic-beta: oauth-2025-04-20) returns"five_hour": nulltogether with a normalseven_daybucket. - Let the pool refresh usage (it does so every 5 minutes), then run
bb pool account list --jsonand open Settings → Account Pooler.
The same code path can be reproduced at unit level: call quotaFromUsage with a previous quota that has fiveHourUtilization: 1, fiveHourStatus: "rejected" and a payload of { five_hour: null, seven_day: { utilization: 30, resets_at: … } }. The result keeps fiveHourUtilization: 1 and fiveHourStatus: "rejected".
Expected vs actual
Read-only usage responses on 2026-11-06 (~02:05Z), fetched with the pool's own access tokens. Accounts are anonymized.
account A (Max 20x) five_hour=null seven_day.utilization=100
account B (Max 20x) five_hour=null seven_day.utilization=30
account C (Max 20x) five_hour={"utilization":0.0,"resets_at":null,…} seven_day.utilization=100
What the pool stores for them (bb pool account list --json, same minute):
account A fiveHourUtilization=0 fiveHourStatus=allowed fiveHourResetAt=2026-10-28T17:49Z (9 days in the past)
account B fiveHourUtilization=0 fiveHourStatus=allowed fiveHourResetAt=2026-10-31T14:40Z (6 days in the past)
account C fiveHourUtilization=0 fiveHourStatus=allowed fiveHourResetAt=2026-11-04T02:00Z (2 days in the past)
- Actual: A and B keep an old 5-hour observation and show a 5H bar, although the provider no longer reports a 5-hour limit for them. All three keep a stale past reset. If an account's last observation before losing its 5-hour limit had been
utilization: 1, status: rejectedwith a future reset, the pool would keep treating it as 5-hour-exhausted until that stale reset passed. - Expected:
five_hour: nullclears the 5-hour fields, and the UI shows that this account has no 5-hour limit (for example "—" in the 5H column, or no 5H bar).resets_at: nulltogether withutilization: 0clears the stored reset, and the UI shows "no window running" instead of a past reset time.
Evidence
five_hour == nullis mapped tonull(usage.ts#L171-L172), and every 5-hour field then falls back to the previous value (usage.ts#L195-L197). The same?? previousfallback keeps a pastfiveHourResetAtwhenresets_atis null.- The account row always includes a 5H column for Claude accounts, which is drawn from the stored value (app.tsx#L328-L333).
- Investigation: bb thread
thr_agudxusj98(private).
What you ruled out
- Not a duplicate of Provider usage retains Claude Max badge after paid subscription lapses, with only a generic refresh warning #6685 (Provider usage keeps a Max badge after a subscription lapses) or Claude usage: 429 from /api/oauth/usage is not cached, Retry-After is ignored, and the last good value is dropped #6669 (429 from the usage endpoint is not cached). Both are about the Provider usage plugin, and neither covers null 5-hour buckets in Account Pooler.
- Not Account Pooler: when every account is past switchThreshold, the pool returns 429 with a far reset although upstream still allows requests #6169:
switchThresholdis 1 here, and routing currently picks these accounts correctly because the stale resets are in the past. The stale-rejected case above is inferred from the code, not observed. - Not a one-off response: a second read 16 minutes later (02:21Z) returned
five_hour: nullagain for A and B. - Real responses don't carry a 5-hour window either. B is the account the pool is routing to right now (last used 02:20Z), yet its stored
fiveHourResetAtis still 2026-10-31.quotaFromHeaderswould have replaced it if the unified 5-hour headers were present. - Not caused by a failing refresh: all three accounts had fresh
observedAtvalues (within 5 minutes) and no OAuth errors.
Suggested priority and effort
Low priority, low effort. It is mostly a misleading display. It can only affect routing in the stale-rejected case described above.
AGENT GENERATED
Activity
Store Account Pooler's Claude 5-hour and 7-day limits as limit windows (
seklow commentedon Nov 11, 2026
Follow-up: #7191 fixed the usage path, but a removed 5-hour window can still stay while the account is busy. Responses without 5h headers keep the old window, and usage refresh skips accounts with requests in flight. Details are in #7418.