Repository navigation
Conversation
…usage Account Pooler reported every account error to Provider usage as the generic error state, so an OAuth login that the token endpoint had rejected kept its last usage on screen behind a group-wide refresh notice. The pool now stores whether an account's error is a rejected login and reports such accounts as expired, which Provider usage shows on the account's own row with a sign-in hint. Fixes get-bb#7417 Co-Authored-By: Claude Fable 5.2 <[email protected]>
Contributor
|
Thanks for the pull request, @seklow. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change. Contributor approval. bb reviews pull requests only from approved contributors, and you are not on the list yet. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to your pull request, and explain what it changes and why. A maintainer then adds you to the list and reopens the pull request. See CONTRIBUTING.md for details. |
This was referenced Nov 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Account Pooler's usage source reported every account error as the generic
errorusage state, including an OAuth login that the token endpoint had rejected (invalid_grant). Provider usage treatserroras a failed refresh: the account's row keeps its last measurement, unmarked, and the whole group gets "Couldn't refresh. Showing last update.", so nothing says which account needs a new sign-in. The usage contract already has anexpiredstate that Provider usage shows on the account's own row with a sign-in hint, but the pool kept only the free-textquota.errorand had no typed record of why an account is in error. Root cause and reproduction: #7417 and its report.What changed
Only
plugins/account-pool.src/hub.ts: an account error that comes from a rejected OAuth refresh (OAuthRefreshError) is stored withloginRejected. A stored error is re-thrown as a login rejection while the account's current refresh token is on record as rejected, so the existing catches keep the classification. This also marks errors stored before this change on the first usage refresh after the upgrade, without sending the rejected token again.src/store.ts,src/contracts.ts,src/quota.ts:AccountQuota.loginRejected, persisted in a newlogin_rejected_errorcolumn that holds the text of the error it classifies. The flag reads true only while that same error is stored, so an older build that clears or replaces the error (rollback) cannot leave a stale classification behind.src/usage-source.ts: accounts withloginRejectedreport theexpiredusage state.bb pool status --jsonandbb pool account list --jsongainloginRejected; the skill reference says so. No daemon wire change.Not changed, and known limits:
error, so a pooled account that has never had a usage observation can keep showing expired after it recovers, until its first observation. That is the Provider usage half of 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, which Provider usage: show a source-reported accounterrorstate on that account's row instead of treating it as a failed refresh of the whole group #7421 tracks.How you verified
pnpm exec turbo run typecheck test lint --filter=bb-plugin-account-pool: 399 tests pass, typecheck and lint are clean.Tests added or extended, for Claude and Codex accounts; each fails without the change:
src/refresh-rejection.test.ts: the flag stays false while a rejected refresh token's access token still works, is set once the account enters error (background expiry and upstream 401), and is cleared by signing in again. An error stored without the flag is marked on the next refresh without another token request. A rejection recorded for a different refresh token leaves the error unmarked.src/server.test.ts: the usage source returnsexpiredafter the rejection and after a failed manual refresh, and its normal state after a successful one.src/store.test.ts: when a build without the column clears the error, or replaces it with another, the flag reads false.I also removed each key line in turn (the stored-error comparison, the typed re-throw, the flag in
failAccount, theexpiredbranch) and confirmed the tests above fail.Not checked in a running app: the row hint for an
expiredpooled account is existing Provider usage behaviour, covered byplugins/provider-usage/app.test.tsx.Fixes #7417
🤖 Generated with Claude Code