Skip to content

fix(account-pool): synchronize short-hold session retries - #3262

Merged
ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-account-pool-short-hold-affinity-thr_9gskvkmehh
Sep 8, 2026
Merged

ymichael merged 1 commit into
mainfrom
bb/ci-flake-fix-account-pool-short-hold-affinity-thr_9gskvkmehh

Conversation

@ymichael

@ymichael ymichael commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

A pinned request that received a short per-minute 429 waited independently from another request for the same session. The second request could finish its remaining hold timer while the wall clock still reported the account as held; because routing tracked only that it had waited once, it returned 429 without making its permitted retry. This produced the four-attempt sequence seen in current-main CI and again in an unrelated PR run.

What changed

Account Pool now records the active per-account pacing flight with its exact hold deadline. Requests that arrive during that hold join the same completion promise and then make their one permitted retry. A completed successful flight remains observable until the wall deadline expires, while a renewed or failed attempt releases it so repeated hold extensions stay bounded. Hub restart also clears the in-memory flights.

The regression keeps the original 250 ms hold and pins the clock one millisecond before the deadline, proving the concurrent request follows the pacing completion event instead of returning a clock-bound 429. No hold duration, retry budget, timeout, wire contract, CLI, or public API changed. The separate 4096-session LRU timeout is not part of this change.

How you verified

  • Red: the controlled-clock regression failed before the implementation with expected 429 to be 200.
  • Green focused: the short-hold regression and repeated-hold bound both passed.
  • pnpm exec turbo run test --filter=bb-plugin-account-pool --concurrency=1 -- --maxWorkers=1 --no-file-parallelism — 9 files and 253 tests passed.
  • pnpm exec turbo run typecheck --filter=bb-plugin-account-pool --concurrency=1 — 4 Turbo tasks passed.
  • pnpm exec turbo run build --filter=bb-plugin-account-pool --concurrency=1 — the two generated prerequisites passed; this source plugin has no package build script.
  • pnpm exec oxfmt --check plugins/account-pool/src/hub.ts plugins/account-pool/src/server.test.ts and git diff --check passed.

AGENT GENERATED: by GPT-5.6-Sol

@ymichael
ymichael merged commit 9ea8862 into main Sep 8, 2026
16 checks passed
@ymichael
ymichael deleted the bb/ci-flake-fix-account-pool-short-hold-affinity-thr_9gskvkmehh branch September 8, 2026 19:58
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