Repository navigation
Keep a nested bb on its parent's Account Pooler through one slow availability read - #8187
Merged
ymichael merged 1 commit intoNov 25, 2026
Conversation
A nested bb in parent proxy mode cached "unavailable" for the full 30 s TTL after a single availability read failed or took over 2 s, so every turn started in that window ran with no login. A failed read now keeps the last good availability and retries after 5 s; the parent is reported unavailable once reads have failed for 60 s. The read timeout is 5 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
|
Thanks for the pull request, @salemsayed. It was closed automatically because it does not meet the requirements below yet. This is an automated check, not a review of the change. Linked issue. Every pull request must close an open issue in this repository. The issue keeps the problem tracked even if this pull request closes or we take a different approach. Open an issue for the change, or find an existing one, and add See CONTRIBUTING.md for details. |
stephendolan
added a commit
to stephendolan/bb
that referenced
this pull request
Nov 27, 2026
…ty failures Sync upstream get-bb#8187 and build for BB0.50.1 SDK0.6.157. Include a tested state-preserving path-to-Git migration with rollback.
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
A nested bb whose Account Pooler proxies to a parent pool decides per turn whether it can route through the parent, using
ParentAvailabilityinplugins/account-pool/src/parent-pool.ts.load()gives the parent's/availability2 s, and on any error or non-OK status returnsUNAVAILABLE_POOL.get()caches that result for the full 30 s TTL, the same as a good answer. So one slow read from a busy parent takes the child off the pool for 30 s, and every turn that starts in that window runs with no pool credentials. On a child with no Claude login of its own, Claude Code answersNot logged in · Please run /loginand Provider Retry skips the turn as not retryable. On one child this happened three times in a day, each time the parent's host was under heavy load.What changed
plugins/account-pool/src/parent-pool.ts:ParentAvailabilityremembers the last good availability.plugins/account-pool/src/parent-pool.test.ts: three cases, all of which fail onmain:How you verified
New tests on
main'sparent-pool.ts: the 3 new tests fail withexpected { claude: false, codex: false } to deeply equal { claude: true, codex: false }, and the other 13 pass. With the change: 16/16.After the final commit:
pnpm exec turbo run typecheck lint test --filter=bb-plugin-account-pool --forcepassed 10/10 tasks, with 14 test files and 402 tests passing. Lint reported 3 warnings, all inapp.tsx, which this PR does not touch.pnpm exec turbo run lint:type-aware --filter=bb-plugin-account-pool --forcepassed 7/7 tasks with 0 warnings.pnpm exec turbo run prepare:bundled --filter=bb-plugin-account-poolpassed 7/7 tasks.oxfmt --checkpasses on both files.Standalone reproduction with real HTTP and the real clock.
ParentAvailabilityuses the realfetchand the shipped TTL and timeouts against a local HTTP parent, and oneget()per second stands in for a turn start.mainand this branch ran side by side.One slow answer (request Milestone 1: shared foundation plus Linux support #2 answers in 8 s, then normal), on
main:With the change:
A parent that stays down (503 from 25 s on), on
main:With the change, the child keeps routing for 60 s after the first failure, then reports the parent unavailable and goes back to reading every 30 s:
repro.mts (run from the repo root as
node_modules/.bin/tsx repro.mts $PWD/plugins/account-pool/src/parent-pool.ts slow-once|down)Not checked: an isolated nested bb against a slow parent bb end to end. The reproduction drives the same class the server constructs, with the same options except
onError.Fixes #8188
🤖 Generated with Claude Code