Repository navigation
Description
Summary
Account Pooler excludes a Claude OAuth account when its subscription usage reaches the switch threshold, even when extra usage is enabled with allowance remaining. This prevents requests from reaching Anthropic to continue on extra usage. Expected: prefer usable accounts with subscription quota remaining, then allow extra usage as a fallback, and return to subscription quota when it recovers.
Versions and environment
- Source reproduction at
7826c68e3db5c8958a4cbbc257792002d5a05457; performed before local implementation edits. - Installed
bb --version:0.44.0; installation method not established. Reproduction runs directly against the source worktree. - macOS 26.5.1 (25F80), Node v22.23.1.
- Claude Code:
2.1.281 (Claude Code); Account Pooler builtin plugin 0.1.0. - Worktree on a macOS host accessed through BB Connect.
- Live pool configuration has Claude routing enabled and
switchThreshold: 0.9995. The default is0.98. - Reproduction scope: deterministic source-level quota parsing and eligibility reproduction with synthetic usage data. No live paid request or live exhausted-account reproduction was performed. The live Claude account was below its limits during investigation.
Steps to reproduce
- Use a dependency-installed checkout at the source commit above, then run
cd plugins/account-pool. - Run the following without real credentials or network requests:
pnpm exec tsx -e '
import { quotaFromUsage } from "./src/usage.ts";
import { isQuotaExhausted } from "./src/quota.ts";
import { EMPTY_FAMILY_WEEKLY } from "./src/contracts.ts";
const now = Date.now();
const previous = {
accountId: "repro",
fiveHourUtilization: null, fiveHourResetAt: null, fiveHourStatus: null,
sevenDayUtilization: null, sevenDayResetAt: null, sevenDayStatus: null,
representativeClaim: null, familyWeekly: EMPTY_FAMILY_WEEKLY,
limitWindows: [], observedAt: null, heldUntil: null, error: null,
};
for (const utilization of [97, 98, 100]) {
const quota = quotaFromUsage("repro", {
five_hour: { utilization, resets_at: new Date(now + 3600000).toISOString() },
extra_usage: { is_enabled: true, monthly_limit: 10000, used_credits: 0, utilization: 0 },
}, previous, now);
console.log(JSON.stringify({
utilization,
extraUsagePreserved: Object.hasOwn(quota, "extra_usage"),
blockedAtDefault: isQuotaExhausted(quota, "opus", 0.98, now),
blockedAtMaxThreshold: isQuotaExhausted(quota, "opus", 1, now),
}));
}'- Observe that the account becomes ineligible at the threshold despite enabled, unspent extra usage. Increasing the threshold to its maximum value of 1 still blocks the account at 100%.
Did not reproduce below the threshold: 97% remains eligible.
Expected vs actual
Actual output, verbatim:
{"utilization":97,"extraUsagePreserved":false,"blockedAtDefault":false,"blockedAtMaxThreshold":false}
{"utilization":98,"extraUsagePreserved":false,"blockedAtDefault":true,"blockedAtMaxThreshold":false}
{"utilization":100,"extraUsagePreserved":false,"blockedAtDefault":true,"blockedAtMaxThreshold":true}
Expected: exhausted subscription windows must not make enabled, available extra usage unreachable when no usable subscription account remains. Disabled or spent extra usage should not bypass the limit. Accounts with available subscription quota should take precedence over extra usage, including conversations previously pinned to an extra-usage fallback.
The hub's no-eligible-account path returns HTTP 429 with No Account Pooler account is currently eligible. This response path was established from source, not captured from a live exhausted account in this investigation.
Evidence
Permalinks at the reproduced commit:
- Usage parsing records subscription windows but ignores extra usage.
- Window eligibility rejects at the configured utilization threshold.
- Selection excludes exhausted shared and family quotas before forwarding.
- No eligible account produces the pooler's own 429.
- The threshold defaults to 0.98 and cannot exceed 1.
- The Claude provider already recognizes allowed overage when normal limits are rejected.
Investigation: BB thread thr_zhebfwg2vz, referenced from this issue's originating BB conversation as @thread:thr_zhebfwg2vz.
What you ruled out
- Not a duplicate of Account Pooler bills Fable to a Team account's extra usage while a pooled Max account includes Fable #3615: that issue concerns selecting a paid-only model entitlement while another plan includes the model. This failure blocks extra usage entirely after subscription-window exhaustion. Model entitlement inference is outside this proposed fix.
- Related to Account Pooler: last-resort accounts, per-account switch thresholds, and an opt-in order by earliest weekly reset #4468, but that issue requests explicit last-resort account settings and other routing controls; this defect is ignored Claude extra-usage eligibility.
- Not resolved by increasing
switchThresholdto 1: the reproduction still rejects at 100%. - Not dependent on credentials, network failures, or a Claude CLI error: the source reproduction invokes only parsing and eligibility functions.
Suggested priority and effort
Medium effort. Blocks continued pooled Claude work when subscription quota is exhausted despite available extra usage. Workaround: bb pool bypass <thread-id> with a valid local Claude login on the execution host. Preserve observed extra-usage state across restarts and expose it through account/status RPC and CLI output; do not enable extra usage or alter Anthropic spending limits.
Checks
- Reproduced at the pinned source commit; live paid usage and latest-release end-to-end behavior are explicitly unverified above.
- Searched open and closed issues for the same problem.
- Included the investigation thread and commit-permalink evidence.
AGENT GENERATED
Activity
SawyerHood commentedon Sep 30, 2026
Verified report: https://get-bb.github.io/reports/issues/4475.html
PARTIALLY REPRODUCED: two clean same-SHA runs of the actual hub returned 429 with zero fake model calls at 98%/100% subscription usage despite synthetic extra allowance. Controls and subscription recovery passed. No real provider request or billing was exercised; PR #4531 remains open and was not tested.
Support Claude and Codex extra-usage fallback and availability (get-b…