Skip to content

Pool multiple Claude accounts: limit-aware load balancing across provider connections #1552

Description

@babebort

Problem

Heavy users run several Claude accounts in parallel (e.g. two Max subscriptions) because one account's usage limit runs out mid-day. Today each bb thread is effectively pinned to whichever account the underlying provider session is logged into: when that account hits its limit, the thread stalls even though another connected account still has plenty of headroom. Spreading the work is fully manual — notice the limit error, switch profiles by hand, restart or re-route the thread.

Requested behavior

Building on the named provider connections proposed in #1447, add an opt-in connection pool for same-provider connections — a routing wrapper that balances threads across all of the user's Claude accounts:

  • Group several explicitly-enabled Claude connections into one pool that a thread can target instead of a single account.
  • Limit-aware routing: start new threads on the connection with the most remaining usage (bb already knows how to read account usage — use it as the balancing signal), with round-robin as the fallback when usage is unknown.
  • Automatic failover: when a turn fails with a rate/usage-limit error, retry it on the next connection in the pool instead of surfacing the error and stalling.
  • Session affinity by default: keep a thread on one connection while it works (provider-side prompt caching and context live there); rebalance at thread start or on limit errors, never mid-turn.
  • Surface pool state in the UI: remaining usage per connection and which connection each thread is currently on.

The explicitness rules from #1447 still apply: pooling only ever spans connections the user explicitly enabled, no silent account discovery, authentication stays provider-owned.

Why this belongs in bb

An external wrapper/proxy can't do this well: good balancing needs bb's own view of thread lifecycle (turn boundaries, safe retry points) and its per-connection usage data, while provider auth must stay provider-owned rather than funneled through a third-party proxy. bb already orchestrates the sessions — it is the natural place for the scheduling decision.

AGENT GENERATED: filed by Claude Code on behalf of a bb user

Activity

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

    provider-claude-codeBuilt-in plugin: provider-claude-codeprovidersCross-provider bridges, models, login

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions