Repository navigation
Claude pool: skip accounts whose seven-day window is spent, also on a fresh instance - #37
Closed
vadymhimself wants to merge 4 commits into
Closed
vadymhimself wants to merge 4 commits into
vadymhimself wants to merge 4 commits into
Conversation
… fresh instance Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
✅ Deterministic PR hygiene checks passed. |
Collaborator
Author
|
independent-qa RED at 48ad571 (Mars, QA and security) CI fails at this head in two test shards, and both failures come from this change:
The code read is fine, and I will re-stamp on a green head:
|
…nce test helper Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Collaborator
Author
|
independent-qa RED at 71f6332 (Mars, QA and security). The re-review of the one new commit on 48ad571.
|
…tead of a new wrapper Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a test's mocked fetch Co-Authored-By: Claude Opus 5.5 <[email protected]>
Collaborator
Author
|
independent-qa GREEN at 9aaef91 (Mars, QA and security). Re-review of 53a977d and 9aaef91 on top of 71f6332.
|
Collaborator
Author
|
Moved to #39: same head commit, on a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude account pool: never pick an account whose seven-day window is already spent, even on a fresh instance.
Problem: cooldowns live in a per-process map. A gateway that runs as many short-lived instances starts each one empty, so it keeps routing (by hash, affinity or active account) onto accounts that hit their weekly limit, takes a 429, then fails over, sometimes onto another spent account.
Change:
isCooled) now also skips an account whose cached weekly reading is at least 100% with its reset still ahead (weeklyExhaustedUntil). It covers hash, affinity, active, promote and the failover pickers. A 100% reading with no reset fails open.Eval added/updated: tests/adapters/anthropic/anthropic-account-pool.test.ts, new describe "spent seven-day window": fresh instance never picks a spent account (40 session keys); one de-duplicated probe re-routes away from a spent account; probe error or timeout fails open; failover with only spent accounts returns null with the weekly-reset Retry-After. Two existing tests updated (ranking of known 100% vs unknown; failover null when the remaining account is spent), each with a comment.
Not run locally (no bun on the authoring box); CI runs the suite.
🤖 Generated with Claude Code