Add Account Pool settings UI with Claude sign-in - #3049
Merged
Conversation
SawyerHood
force-pushed
the
bb/account-pool-login
branch
from
September 4, 2026 04:39
3365910 to
ed53906
Compare
SawyerHood
force-pushed
the
bb/account-pool-login
branch
from
September 4, 2026 05:09
ed53906 to
4f66506
Compare
SawyerHood
marked this pull request as ready for review
September 4, 2026 05:14
SawyerHood
added a commit
that referenced
this pull request
Sep 4, 2026
…rite (#3053) Standalone follow-up to the Account Pool stack (#3035, #3036, #3042, #3049); based on main. ## Human comments ## What was wrong Account Pool selected accounts using only shared 5-hour and 7-day quota observations, even though Anthropic applies separate weekly limits to model families such as Fable. Scoped `7d_<bucket>` headers were recorded as opaque diagnostics and never governed selection, the OAuth usage endpoint was not polled, and Claude Code request metadata could retain an account UUID belonging to a different OAuth account after routing. Part of #1552. ## What changed - Replaced opaque bucket exhaustion diagnostics with fixed Fable, Sonnet, Opus, Haiku, and other weekly quota slots carrying utilization, reset, status, observation time, and source. - Added five-minute idle OAuth usage refreshes, immediate refresh after add or enable, scoped usage-limit parsing, and lazy account UUID backfill through the OAuth profile endpoint. Refresh failures preserve the last known state. - Parsed the request model once and made eligibility and reset tie-breaking use its governing family bucket. Scoped 429 responses now rotate accounts without globally exhausting the rejected account. - Stored account UUIDs during Claude Code import and OAuth sign-in, and guarded request rewriting to the selected account for recognized stringified-JSON and `user_*_account_<uuid>_session_*` metadata forms. Unrecognized, absent, non-JSON, or UUID-less requests remain byte-identical. - Added dynamic family columns to `bb pool account list` and updated the CLI skill, plugin guide, and configuration docs. - Added focused migration, usage parsing/refresh, family routing, scoped-header/429, UUID import/sign-in/backfill/rewrite, passthrough, CLI, and app regression coverage. There is no Plugin SDK or server/host-daemon wire change, so neither protocol version changed. ## How you verified - `pnpm exec turbo run typecheck test --filter=bb-plugin-account-pool --continue --force` — 6 tasks passed; 4 test files and 35 tests passed. The new routing, scoped-429, refresh, migration, and UUID tests fail against the prior implementation and pass with this change. - `pnpm exec turbo run typecheck test --filter=@bb/templates --continue --force` — 7 tasks passed; 7 test files and 43 tests passed. - `pnpm exec turbo run typecheck --filter=@bb/server --continue` — 5 tasks passed. - `pnpm --silent bb plugin build plugins/account-pool` — server and app bundles built successfully. - `git diff --check origin/main...HEAD` — passed after rebasing onto current `origin/main`. - Isolated dev-app proof with two OAuth accounts and `switchThreshold=0.70`: Account A had shared 7d at 43% but Fable at 80%; Account B had Fable at 7%. A real `claude-fable-5-1` turn completed through Account B, then a real `claude-sonnet-5` turn completed through Account A, proving family-only exhaustion does not disable the account globally. A redacted shape probe on a further real turn found `metadata.user_id` present without a recognized account UUID component, so the production path correctly preserved it byte-for-byte. The probe was removed, both imported test accounts were removed from the isolated store, and the dev app was stopped. Evidence is attached to BB-94. Part of #1552 > AGENT GENERATED
This was referenced Sep 9, 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.
Stack layer 4 of 4 (top). Prerequisites: #3035, #3036, and #3042 below it in this stack.
Human comments
What was wrong
Account Pool had no settings UI or interactive Claude login path, so users had to provision accounts through the CLI. The plugin could also report
needs-configurationwhen empty, but the app frontend loader discarded every plugin frontend outsiderunning; that made the configuration UI that an empty pool needs impossible to load. Part of #1552.What changed
bb pool account add --provider claude --loginprints the authorization URL and session ID, thenbb pool account login-complete --session <id> --code-stdincompletes it without putting the pasted code in process arguments.--<name>-stdinflag becomes--<name> <single-line-value>with the existing 16 KiB limit; core contains no Account Pool-specific routing.needs-configurationanddegradedplugins, with regression coverage for all supported settings statuses.HOST_DAEMON_PROTOCOL_VERSIONis unchanged.How you verified
pnpm exec turbo run typecheck test --filter=bb-plugin-account-pool --filter=@bb/cli --filter=@bb/app --filter=@bb/templates --continue --force— 14/14 tasks passed: Account Pool 28 tests, CLI 530 tests, app 3,853 tests (4 skipped), templates 43 tests.pnpm --silent bb plugin build plugins/account-pool— emitted server and app JS/CSS/meta bundles.pnpm install --frozen-lockfile --offline— lockfile accepted without resolution changes.type=password, imported the machine OAuth account, ran Claude Code threadthr_qr935hirfwto anokresponse through the pool, observed 5-hour/7-day utilization, removed the account in the UI, and confirmed its mode-600 secret file was deleted. Screenshots and command artifacts are attached to BB-92.Part of #1552