Skip to content

Account Pooler: one slow parent availability read drops a nested bb off its parent pool for 30 s #8188

Description

@salemsayed

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.ts is unchanged on main at fb045a046.

Steps to reproduce

  1. Run a nested bb with BB_ACCOUNT_POOL_PARENT_URL and BB_ACCOUNT_POOL_PARENT_TOKEN set and Account Pooler in parent mode, with no Claude login on the child.
  2. Make the parent's GET /availability answer once in more than 2 s, or return a 5xx once (a loaded parent does this on its own).
  3. 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:

const DEFAULT_AVAILABILITY_TTL_MS = 30_000;
const AVAILABILITY_TIMEOUT_MS = 2_000;

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

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

  1. added theissue type on Nov 25, 2026
  2. added
    providers
    confirmed-repro
    on Nov 25, 2026
  3. bb-slop-cop commented on Nov 25, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Medium priority · Low effort. Labels: providers, confirmed-repro.
    • Reproduction report: REPRODUCED, high root-cause confidence. Repeated by the same agent in a second clean checkout of trusted main (fb045a046).
    • Root cause: a failed availability refresh becomes an all-false answer cached for the full 30-second success TTL, discarding previously positive availability and suppressing recovery reads.
    • Evidence: authored real-HTTP timeout and HTTP 503 regression cases fail as expected in both checkouts; all 13 existing parent-pool tests pass. Actual Claude login/retry behavior was not exercised.
    • No new PR: open Keep a nested bb on its parent's Account Pooler through one slow availability read #8187 already links this issue; its diff was reviewed statically, without executing its branch.
  4. added a commit that references this issue on Nov 25, 2026
    cf26634
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions