Repository navigation
Description
Summary
One Claude account in my Account Pooler lost its login: its OAuth refresh was rejected with invalid_grant: Refresh token expired. Provider usage then showed only "Couldn’t refresh. Showing last update." for the whole Account Pooler group. The failing account's row kept its last usage bars and looked like every healthy row, so nothing said which account was broken or that it needed a new sign-in. I expected that row to say the session expired and that I should sign in again (Provider usage already has this message for pooled accounts), and the other accounts to show without a warning.
Versions and environment
- bb 0.49.0 (npm
bb-app, systemd user service), Debian 13.7. Built-in Account Pooler with several Claude OAuth accounts and one Codex OAuth account; built-in Provider usage. - Code checked against
mainat365d7c5237ae270be0555b5b44ea61020252713e. The installed 0.49.0 bundles have the same logic (snippets under Evidence).
Steps to reproduce
Observed on a live account. I can't make a refresh token expire on demand, so I haven't reproduced it a second time.
- Use Account Pooler with two or more Claude OAuth accounts, and open Provider usage once so every account has a measurement.
- Let one account's refresh token become invalid. Mine was a login added to the pool on 2026-10-19, and its refresh token expired.
- Once that account's access token has expired, click Reload in Provider usage.
Closest repro without a live failure (traced in the code, not run): for an account whose entry in bb pool account list --json has a non-null error, bb plugin rpc call account-pool provider-usage.v1.getResource --input-file <file> with {"resourceId":"<id>","refresh":false} returns usage: {"status":"error", …, "message":"Usage could not be collected for this account. Try refreshing usage."}. Feeding that result to Provider usage's getUsage after an earlier successful fetch returns the account with its old ok windows, plus error: "Some usage could not be refreshed." on the source:<plugin> machine.
Expected vs actual
Pool log (~/.bb/plugins/account-pool/logs/plugin.log, JSON lines shown as time, level and message; account id replaced with A):
2026-11-11T03:24:36.659Z warn Account Pooler claude account A OAuth refresh failed: OAuth refresh failed with HTTP 400. invalid_grant: Refresh token expired. expiresAt=1794367707962, forced=false.
2026-11-11T03:31:16.596Z warn Account Pooler claude account A OAuth refresh failed: OAuth refresh failed with HTTP 400. invalid_grant: Refresh token expired. expiresAt=1794367707962, forced=true.
The first rejection came before the access token expired at 03:28:27Z, and after a rejected proactive refresh the pool keeps using a token that hasn't expired yet (hub.ts#L1197-L1201). Once a refresh token has been rejected, the pool asks the token endpoint again only during a manual usage refresh of an account whose error is already set (hub.ts#L366-L372, #L1127-L1135). So by 03:31Z the pool had account A in error. I signed A in again at about 03:35Z, and it is now ready with error: null.
Before the re-sign-in, Provider usage showed:
Couldn’t refresh. Showing last update.
- Actual: The notice names no account. Account A's row kept its plan badge, bars, percentages and reset countdowns from the last good measurement, with no marker and no age. The reason (
invalid_grant, sign in again) appears nowhere in Provider usage. By the code, Account Pooler's settings label the accountErrorbut don't show the message either, and the notice belongs to the whole Account Pooler group, so it also appears on that group's Codex tab. - Expected: Account A's row shows the existing pooled-account hint, "This account’s session expired. Sign in again in the source plugin’s settings, then reload usage.", and the other accounts show without a group-wide warning. If an error isn't about authentication, the row should keep its last values, marked as stale and showing the source's message.
Evidence
- Account Pooler reports every account error as a generic
error. Any non-nullaccount.errorbecomes{ status: "error", …, message: "Usage could not be collected for this account. Try refreshing usage." }(usage-source.ts#L143-L160). The source never returns the contract'sexpiredorunauthenticatedstates (usage-source-contract.ts#L42-L56). The account'serroris a free-text string (hub.ts#L1452-L1458) with no error kind, so the usage source can't tell a rejected login from any other failure without parsing that text. - Provider usage turns that state into a failed fetch.
fetchResourcethrowsUsage could not be refreshed.onstatus: "error"before storing the measurement (server.ts#L191-L198).readUsageadds the account tofailures(#L299-L303). It then renders the cached last good measurement and setserror: "Some usage could not be refreshed."on the whole group (#L354-L361). The flag clears after a later successful fetch (#L195-L196). - Any group error becomes the generic notice. This happens in the sidebar card (app.tsx#L612-L625) and in Settings (settings.tsx#L393-L399). The server's error text is deliberately hidden (app.test.tsx#L542-L544).
- The per-row states exist but are never reached here. Rows already render
expired,unauthenticatedanderror(app.tsx#L329-L347, settings.tsx#L355-L364). For pooled accounts the server adds theexpiredHintquoted above (server.ts#L142-L149), and a test renders anexpiredshared-source row with its hint (app.test.tsx#L468-L477). Because onlyerrorthrows, anexpiredresult would be stored and shown on its row. Theerrorrow branch can't be reached from any source. - Contract. The contract says "Per-account authentication and collection failures are usage states. observedAt is the last successful measurement time." (usage-source-contract.ts#L130). Here, though, the authentication failure arrives as a collection failure, which Provider usage then treats as a failed refresh.
observedAtisn't in the panel's data model (usage-schema.ts#L37-L48).
Installed 0.49.0 bundles (server/dist/builtin-plugins/):
account-pool/dist/server.js h=(a.error===null?null:"Usage could not be collected for this account. Try refreshing usage.")??(a.observedAt===null?…
provider-usage/dist/server.js if(b.usage.status==="error")throw new Error("Usage could not be refreshed.")
provider-usage/dist/server.js (w.error!==null||r.has(ie))&&(y.error="Some usage could not be refreshed.")
Investigation: bb thread thr_agudxusj98 (private).
What you ruled out
- Not Account Pooler: rejected OAuth refresh (invalid_grant) leaves Claude account
readywith stale quota instead of error #7121, where a rejected refresh in 0.48.1 left the accountready. In 0.49.0 the pool does store the error; this report is about how that error is shown. - Not a duplicate of Provider usage retains Claude Max badge after paid subscription lapses, with only a generic refresh warning #6685, though the Provider usage mechanism is the same: a failed refresh keeps the last measurement behind a generic notice. Provider usage retains Claude Max badge after paid subscription lapses, with only a generic refresh warning #6685 is about the host Claude Code provider and a plan badge, and its failure cause was never captured. Here the cause is known, and part of the fix belongs in Account Pooler. I'll cross-link from Provider usage retains Claude Max badge after paid subscription lapses, with only a generic refresh warning #6685.
- Not Claude usage: 429 from /api/oauth/usage is not cached, Retry-After is ignored, and the last good value is dropped #6669 (429 handling in
provider-claude-code) or Claude Code OAuth expiry: classify authorization failures and recover sign-in inside BB #3337 (OAuth expiry on the host provider). Account Pooler: re-authenticate an existing account in place, add accounts disabled or with a priority, and show login expiry #6170 (show login expiry in Account Pooler) would have warned earlier but wouldn't change this display. - Still present on
main: the files cited above are the same at thedesktop-v0.49.0tag and onmain, and no open PR touches this logic.
Suggested priority and effort
Low to medium. Anyone whose pooled login expires or is revoked sees a warning that names no account, while the broken row looks healthy. Workaround: the error field in bb pool account list --json, or the Error label in Account Pooler settings. Possible fixes:
- Account Pooler: report a rejected login as
{ status: "expired" }. Provider usage already stores that state and shows the sign-in hint on the right row, and this also removes the group notice. One way is an error kind stored next to the free-textquota.error. - Provider usage: show a source's
errorresult on its own row (last values marked as stale, plus the message) instead of folding it into the group flag. The panel's data model has no stale or age field for this yet.
Checks
- I reproduced this on the latest release or on
main, or I say above that I could not. (Observed on 0.49.0, the latest release; not reproducible on demand.) - I searched open and closed issues for the same problem.
- If an agent wrote this, the body ends with
> AGENT GENERATEDand links the thread or report.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 11, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotClassification: Bug · Priority: Medium · Effort: Medium · Labels:
providers,confirmed-repro.Verdict: REPRODUCED · Confidence: high. The same agent reproduced the failure twice on trusted main in separate checkouts, using synthetic OAuth rejection with the real pool, usage source and consumer. Existing focused suites pass (16 tests). No live credentials were used; browser screenshots were unavailable because Chrome is absent.
Reproduction and root-cause report, including the complete regression test and expected/actual results.
Root cause: Account Pooler collapses authentication failures into a generic usage error. Provider usage discards that state, retains the cached healthy row, and warns on the whole group.
No PR: the complete repair spans two plugins and the requested stale-values/age display requires a panel RPC schema change, outside this rule’s simple-fix limits.
seklow commentedon Nov 11, 2026
The two halves are now tracked separately. #7420 handles the Account Pooler half: a rejected login is reported as
expired, so its row shows the sign-in hint. #7421 asks for sign-off on the Provider usage half: what the panel shows when a source reportserrorfor an account.rvnikita commentedon Dec 1, 2026
Same here on bb 0.49.0 (macOS, server on a Mac mini). Two Claude OAuth accounts in the pool hit
invalid_grant: Refresh token expiredon 2026-11-25, roughly a month after they were signed in. The pool kepterror: nullfor both, and Provider usage kept showing their last quota bars as normal, so nothing said they needed a new sign-in. The failures were only inplugins/account-pool/logs/plugin.log, repeating.The visible symptom came days later. Once the two remaining accounts used up their windows, every turn failed with
429 · No Account Pooler account is currently eligible. Next account is expected to be available at …. That message gives only the next reset time, not that two accounts were out because their sign-in had died. Signing both in again fixed it right away.As a stopgap I wrote a local plugin that registers as a second
provider-usage.v1source. It lists only pool accounts whose newestinvalid_grantrefresh failure in the pool log is newer than theirobservedAt, and reports them asstatus: "expired". That works, but it's a workaround for what this issue asks for: the pool's owngetResourceshould returnexpired(or a per-row error) once refresh is rejected withinvalid_grant. It would also help if the "no account eligible" 429 mentioned accounts that are out because their sign-in expired.