Skip to content

Account Pooler: rejected OAuth refresh (invalid_grant) leaves Claude account ready with stale quota instead of error #7121

Open

Description

@TPOHH

Summary

A Claude OAuth account in Account Pooler whose refresh token was rejected (HTTP 400 invalid_grant) kept showing status: ready, error: null, and its last observed quota (5h 98%, 7d 100% / rejected) for about 22 hours — long after both windows had reset. Nothing in the UI or bb pool account list indicated the account needed a new sign-in; the failure was only visible in the server log, repeated every five minutes. bb pool account refresh <id> returned ok: true without changing anything.

Versions and environment

  • bb 0.48.1 (npx/desktop install), bb server moved to a remote Linux host (Ubuntu 24.04) with bb server move, reached through bb Connect. Desktop app on macOS.
  • Account Pooler enabled; 2 Claude OAuth accounts (Max) + 1 Codex OAuth account.
  • The affected account was added with bb pool account add --provider claude --import on the bb server host, where Claude Code 2.1.318 is signed in to the same Claude account.

Steps to reproduce

  1. On the bb server host, sign Claude Code in: claude auth login.
  2. bb pool account add --provider claude --import.
  3. On the same host, use Claude Code directly, outside the pool (e.g. claude -p "hi"), so the CLI refreshes its OAuth token. Refresh tokens rotate, so the copy the pool imported becomes invalid. (This is my best explanation of how the token was invalidated; I did not capture the exact refresh that rotated it.)
  4. Wait for the pool's access token to expire.
  5. Run bb pool account list --json and open the pool usage popover.

Expected vs actual

Expected: after the token endpoint rejects the refresh token with 400 invalid_grant, the account is marked as an error (per the docs: "An account enters error only when its OAuth refresh token is rejected (HTTP 400 or 401 from the token endpoint)"), the UI asks to re-authenticate, and the stale quota is not presented as current.

Actual, ~22 h after the last successful observation (identifiers redacted):

fiveHourUtilization  0.98     fiveHourResetAt   <yesterday 19:59>   fiveHourStatus  allowed
sevenDayUtilization  1        sevenDayResetAt   <today 13:59>       sevenDayStatus  rejected
observedAt           <yesterday 18:52>
status               ready
error                null

Server log, every ~5 minutes:

{"level":40,"component":"server","msg":"[plugin:account-pool] Account Pooler claude account <id> OAuth refresh failed: OAuth refresh failed with HTTP 400. invalid_grant. expiresAt=<yesterday 22:23>, forced=false."}

bb pool account refresh <id> --json returned "ok": true and the same account object, with observedAt unchanged and error: null; the log line after it still said forced=false.

The popover showed 98% / 100% for this account, while the per-machine usage view for the same Claude account (read from the host's own Claude Code login) correctly showed 0% / 0%.

Evidence

  • Other pool accounts on the same host refreshed normally during the same period (fresh observedAt), so this was not a network or upstream outage.
  • Re-adding the account with --import produced a new entry that immediately reported 0% / 0% with a fresh observedAt; the old entry stayed stale until removed.
  • Code at fa30b0a: in hub.ts refresh failure handling, an OAuthRefreshError records the rejected refresh token (recordRejectedRefresh) and rethrows; the account error is set from the usage-refresh path at hub.ts#L370-L380. I could not determine from the code why error stayed null in this case — that is the part to investigate.

What I ruled out

Suggested priority and effort (optional)

Medium. Workaround exists (remove and re-add the account), but the failure is silent: the pool presents a dead account as ready with a plausible-looking but stale quota, so users conclude the limits did not reset. Surfacing error (and ideally marking quota as stale when observedAt is far older than the reset times) would make it obvious.

AGENT GENERATED — written by a Claude Code agent in a bb thread after diagnosing the issue on the user's bb server; logs and JSON above are trimmed and redacted.

Activity

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

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority: Medium · Effort: Medium · providers.
    • Report: https://get-bb.github.io/reports/issues/7121.html
    • Verdict: ALREADY FIXED on main · root-cause confidence: medium · reproduction label: no-repro.
    • Cause: The released 0.48.1 usage-refresh path only persisted an error when the account already had one, silently swallowing a first terminal refresh failure. Commit 6e77fce8c7 (Keep pooled accounts serving after a rejected proactive OAuth refresh #6661), merged November 2, fixes that transition and suppresses automatic rejected-token replays; the desktop 0.48.1 release was published October 30. The actual deployed bundle remains unverified.
    • Evidence: Both background and manual stale-quota probes pass on fa30b0a7dc in two clean checkouts (15 tests each); the full plugin suite passes all 390 tests. Expired credentials surface status: error, not ready.
    • Pull request: None: main already contains the matching repair, so there is no failing current-main regression to justify another patch.
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

    no-reproproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions