Repository navigation
Description
Summary
A nested bb whose Account Pooler proxies to a parent pool (BB_ACCOUNT_POOL_PARENT_URL, parent mode) loses pool routing for 30 s whenever one read of the parent's /availability fails or takes longer than 2 s. A turn that starts in that window runs with no pool credentials. On a child with no Claude login of its own, Claude Code answers Not logged in · Please run /login, and Provider Retry skips the turn as not retryable.
Versions and environment
- Child: bb 0.50.2-nightly.45486331951.1 on a Linux VM, no provider login of its own, Account Pooler in parent proxy mode. The parent pool is reached through a tunnel (
http://127.0.0.1:47731/api/v1/plugins/account-pool/http). - Parent: bb on a Linux server with 16 cores. Its load average was around 30 and swap was full at the time.
- Code:
plugins/account-pool/src/parent-pool.tsis unchanged onmainatfb045a046.
Steps to reproduce
- Run a nested bb with
BB_ACCOUNT_POOL_PARENT_URLandBB_ACCOUNT_POOL_PARENT_TOKENset and Account Pooler in parent mode, with no Claude login on the child. - Make the parent's
GET /availabilityanswer once in more than 2 s, or return a 5xx once (a loaded parent does this on its own). - Start a Claude Code turn on the child within the next 30 s.
A standalone reproduction drives the real ParentAvailability with real fetch against a local HTTP parent, using the shipped TTL and timeout. The parent answers normally, then answers request #2 in 8 s, then normally again. One get() per second stands in for a turn start.
Expected vs actual
Expected: one slow answer does not drop the child off the parent pool. Only a parent that stays down is reported unavailable.
Actual, from the child's server log at 2026-11-25 13:30:05 (Africa/Cairo):
[plugin:account-pool] Account Pooler could not read parent availability: The operation was aborted due to timeout.
Two seconds later a turn started without pool routing. Claude Code replied Not logged in · Please run /login, the thread showed "Execution settings changed; the Claude session was rebuilt to apply them.", and Provider Retry logged Automatic retry skipped ...: not-retryable. The same timeout was logged on 2026-11-24 at 21:08 and 22:24.
Standalone reproduction on main:
[ 0.0s] parent: request #1 -> 200 {claude:true}
[ 0.1s] child: turn start -> ROUTED (claude via parent pool)
[ 30.2s] parent: request #2 answering in 8s
[ 32.2s] child: warn could not read parent availability: The operation was aborted due to timeout
[ 32.2s] child: turn start -> NOT ROUTED (turn runs with no login) after waiting 2003ms
[ 62.3s] parent: request #3 -> 200 {claude:true}
[ 62.3s] child: turn start -> ROUTED (claude via parent pool)
summary: 43 turn starts routed, 30 not routed, 3 parent requests
Evidence
ParentAvailability.load() aborts the read after AVAILABILITY_TIMEOUT_MS (2 s) and returns UNAVAILABLE_POOL on any error or non-OK status. get() caches that result for DEFAULT_AVAILABILITY_TTL_MS (30 s), the same TTL as a good answer:
bb/plugins/account-pool/src/parent-pool.ts
Lines 13 to 14 in fb045a0
| const DEFAULT_AVAILABILITY_TTL_MS = 30_000; | |
| const AVAILABILITY_TIMEOUT_MS = 2_000; |
bb/plugins/account-pool/src/parent-pool.ts
Lines 77 to 108 in fb045a0
| async get(): Promise<PoolAvailability> { | |
| const cached = this.cached; | |
| if (cached !== null && cached.expiresAt > this.options.now()) { | |
| return cached.value; | |
| } | |
| const value = await this.load(); | |
| const ttlMs = this.options.ttlMs ?? DEFAULT_AVAILABILITY_TTL_MS; | |
| this.cached = { value, expiresAt: this.options.now() + ttlMs }; | |
| return value; | |
| } | |
| private async load(): Promise<PoolAvailability> { | |
| try { | |
| const response = await this.options.fetch( | |
| `${this.options.parent.baseUrl}${AVAILABILITY_PATH}`, | |
| { | |
| method: "GET", | |
| headers: { [HUB_TOKEN_HEADER]: this.options.parent.token }, | |
| signal: AbortSignal.timeout(AVAILABILITY_TIMEOUT_MS), | |
| }, | |
| ); | |
| if (response.ok) { | |
| return poolAvailabilitySchema.parse(await response.json()); | |
| } | |
| this.options.onError?.( | |
| new Error(`parent availability returned HTTP ${response.status}`), | |
| ); | |
| } catch (error) { | |
| this.options.onError?.(error); | |
| } | |
| return UNAVAILABLE_POOL; | |
| } |
What I ruled out
- Not Provider Retry: re-evaluate pending and declined pool-routed retries when Account Pooler availability changes #6172. That issue is about Provider Retry re-evaluating declined retries when availability changes. This one is about availability being reported false while the parent is up.
- The parent pool itself was not down: its server was overloaded and slow, and the child logged a timeout, not a refused connection or an HTTP error.
Suggested priority and effort
Hits every nested bb in parent proxy mode whose parent is ever slow. Small, contained to parent-pool.ts.
AGENT GENERATED
Activity
bb-slop-cop commentedon Nov 25, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotproviders,confirmed-repro.fb045a046).Keep a nested bb on its parent's Account Pooler through one slow avai…