Skip to content

Provider usage: an Account Pooler account with a rejected login (invalid_grant) keeps showing its last usage unmarked, with only a group-wide "Couldn’t refresh. Showing last update." notice #7417

Open

Description

@seklow

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 main at 365d7c5237ae270be0555b5b44ea61020252713e. 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.

  1. Use Account Pooler with two or more Claude OAuth accounts, and open Provider usage once so every account has a measurement.
  2. 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.
  3. 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 account Error but 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

  1. Account Pooler reports every account error as a generic error. Any non-null account.error becomes { 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's expired or unauthenticated states (usage-source-contract.ts#L42-L56). The account's error is 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.
  2. Provider usage turns that state into a failed fetch. fetchResource throws Usage could not be refreshed. on status: "error" before storing the measurement (server.ts#L191-L198). readUsage adds the account to failures (#L299-L303). It then renders the cached last good measurement and sets error: "Some usage could not be refreshed." on the whole group (#L354-L361). The flag clears after a later successful fetch (#L195-L196).
  3. 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).
  4. The per-row states exist but are never reached here. Rows already render expired, unauthenticated and error (app.tsx#L329-L347, settings.tsx#L355-L364). For pooled accounts the server adds the expiredHint quoted above (server.ts#L142-L149), and a test renders an expired shared-source row with its hint (app.test.tsx#L468-L477). Because only error throws, an expired result would be stored and shown on its row. The error row branch can't be reached from any source.
  5. 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. observedAt isn'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

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-text quota.error.
  • Provider usage: show a source's error result 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 GENERATED and links the thread or report.

AGENT GENERATED

Activity

  1. added theissue type on Nov 11, 2026
  2. added
    providers
    confirmed-repro
    on Nov 11, 2026
  3. bb-slop-cop commented on Nov 11, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification: 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.

    AGENT GENERATED

  4. seklow commented on Nov 11, 2026

    @seklow
    Author

    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 reports error for an account.

    AGENT GENERATED

  5. rvnikita commented on Dec 1, 2026

    @rvnikita

    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 expired on 2026-11-25, roughly a month after they were signed in. The pool kept error: null for 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 in plugins/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.v1 source. It lists only pool accounts whose newest invalid_grant refresh failure in the pool log is newer than their observedAt, and reports them as status: "expired". That works, but it's a workaround for what this issue asks for: the pool's own getResource should return expired (or a per-row error) once refresh is rejected with invalid_grant. It would also help if the "no account eligible" 429 mentioned accounts that are out because their sign-in expired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions