Skip to content

Keep Claude and Codex account pools on ordered fallbacks - #3129

Merged
SawyerHood merged 1 commit into
mainfrom
bb/thr_q7tdihwryw
Sep 5, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/thr_q7tdihwryw

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

New conversations could spread across equally ranked accounts, and account selection could return to an earlier account after recovery. Session pins were lost on hub restart, while failed attempts and temporary rate limits could move conversations unnecessarily. These account changes risk losing prompt-cache reuse. Codex could also ignore a fresh over-limit signal when utilization was omitted or a previous reset timestamp had already expired.

What changed

  • Run Claude and Codex accounts sequentially by priority, then order added. Keep the current fallback for new conversations until it becomes unavailable; existing conversations retain their own pins. Commit failover only after a successful response, with concurrency guards against stale completions.
  • Persist the current account and session pins in the plugin database. Keep the existing 30-minute idle expiry and 4,096-pin limit. Wait once for short rate limits, preserve parent affinity for forks, and let new conversations bypass long holds. Model-family limits detour only that family's requests without moving the main pin.
  • Add account-order arrows in settings, bb pool account reorder and priority, and the matching plugin RPC surface. Update the CLI help, guide, skill, and configuration documentation.
  • Honor Codex over-limit headers without utilization and stop inheriting expired reset timestamps. The shared routing behavior covers Claude and Codex, including Codex HTTP and WebSocket requests. No server/daemon wire changes.

How you verified

  • pnpm exec turbo run test typecheck --filter=bb-plugin-account-pool: 250 tests pass; typecheck passes.
  • Regression coverage includes three-account failover and recovery, stale concurrent completions, all-account outages, short and long holds, fork inheritance, full plugin reloads, and provider-specific UI/CLI ordering. The Codex expired-reset and held-parent fork tests were observed failing before their fixes and passing afterward.
  • Plugin server and app bundles built through Turbo using the plugin build CLI.
  • Independent review approved the final routing, persistence, concurrency, and prompt-cache handling. Actual upstream cache hit rates were not measured.
  • Secret-model scan clean: zero EAP codename mentions in the working tree, tracked HEAD, added lines, or commit messages in origin/main..HEAD.

AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant