Repository navigation
Show cached Account Pooler usage while status loads - #3440
Merged
SawyerHood merged 1 commit intoSep 10, 2026
Merged
SawyerHood merged 1 commit into
SawyerHood merged 1 commit into
Conversation
The settings RPC asked every recently routed machine for its provider state over host RPC, so one sleeping laptop held the whole settings page on "Loading…". Move that lookup to its own status.routedThreads RPC, keep the CLI report shape by merging both calls, and cache the last status in localStorage so rows render immediately with a refreshing indicator until live values arrive. Rows also show a refreshing state while a manual usage refresh is in flight. Co-Authored-By: Claude Fable 5.1 <[email protected]>
SawyerHood
deleted the
bb/it-always-takes-the-account-pooler-a-while-to-sh-thr_xrwdxb2gcd
branch
September 10, 2026 21:49
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
Opening Account Pooler settings sat on "Loading…" for a long time. The
status.getRPC assembledroutedThreadsWithoutLocalLogin, which callssystem.providerStatesover host RPC for every machine that routed a thread in the last window. A sleeping or offline machine stalls that call up to the host RPC deadline, and the UI rendered nothing until the whole status returned. Every action afterward (toggle, refresh usage, reorder) re-ran the same slow status call.What changed
plugins/account-pool/src/operations.ts,rpc.ts,contracts.ts:status.getno longer waits on host RPCs. The routed-thread inspection is its ownstatus.routedThreadsRPC.statusSchemadropsroutedThreadsWithoutLocalLogin; a newstatusReportSchema/PoolStatusReportkeeps the combined shape.plugins/account-pool/src/cli.ts:bb pool statuscalls both operations and prints the same text and--jsonoutput as before.plugins/account-pool/app.tsx: the settings view caches the lastPoolStatusinlocalStorage(validated withstatusSchemaon read) and renders it immediately. While the live status is in flight the hub line shows "refreshing…", rows show "refreshing usage…", and quota values are dimmed. A row also shows the refreshing state while its manual "Refresh usage" RPC is pending. The empty-state card only renders from live status so a stale cache never flashes "No accounts in the pool".No wire changes to the host daemon protocol; this is plugin-internal RPC.
How you verified
plugins/account-pool/app.test.tsx: cached accounts render with the refreshing indicator beforestatus.getresolves and the cache is rewritten afterward; a malformed cache entry falls back to the loading state; a row shows "refreshing usage…" whileaccount.refreshUsageis pending. The first and third fail on main (no cache, no indicator).plugins/account-pool/src/server.test.tsupdated to read routed threads fromstatus.routedThreadsand parse CLI JSON withstatusReportSchema.pnpm exec turbo run test typecheck --filter=bb-plugin-account-poolpasses (10 files, 274 tests).buildPluginAppto confirm the runtimestatusSchemaimport bundles cleanly.🤖 Generated with Claude Code