Repository navigation
feat(routing): add reset-near-weighted account pool strategy - #8180
Conversation
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
⏳ DRAFT
What to do
Review readiness checklist
0/4 boxes ticked. Automatic draft conversion failed. Please convert this pull request to a draft manually until every box above is ticked. Hygiene✅ Deterministic PR hygiene checks passed. |
|
Maintainer review (contributor-backlog lane), head Opt-in, it falls back to round-robin, and it extends
|
|
Merge-manager review: the owner accepted the reset-near-weighted strategy, but this needs rework before it can merge:
|
|
Maintainer security review (lane L3, gpt-6.2-sol, two rounds; the latter at exact head c097bcb): SECURITY APPROVE for the restricted
Focused routing, kernel and failover tests pass (522/0), as do typecheck, structure:check and privacy:scan. Applying |
8a64794 to
7530de2
Compare
Co-authored-by: vibewriter-hand <337401476+vibewriter-hand@users.noreply.github.com>
7530de2 to
a7e7b3d
Compare
|
Maintainer integration record (lane L3, 2026-11-19). Integrating exact head
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7e7b3dc9f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (state.hasWeightedScores && !weighted) { | ||
| state.currentWeights.clear(); | ||
| state.hasWeightedScores = false; |
There was a problem hiding this comment.
Preserve weighted scores across request-specific candidate sets
When Anthropic model routes alternate between [a,b,c] and [a,b], with b the qualifying reset target and stickyLimit: 1, the two-account route computes equal weights and clears the shared instance's entire score map. A reproduction using the actual kernel produced b,a for all 100 alternating pairs, leaving healthy c without assignments even on the full-pool route. This affects normal routing because anthropic-routing.ts shares one poolKey across model routes. Scope the reset to the candidate ring, or otherwise preserve accumulated scores when a request-specific subset happens to have equal weights.
Useful? React with 👍 / 👎.
Summary
reset-near-weightedstrategy for the Codex and Anthropic OAuth account pools.Verification
bun run typecheck— 2,317 files, no type errors.bun test tests/routing/machine-weighted-routing.test.ts tests/codex-integration/codex-pool-rotation.test.ts— 124 pass, 0 fail.Screenshot
Maintainer carry (2026-11-18)
Maintainers carried the review rework on this branch after a
devmerge (29c2dd2): Anthropic keyed and keyless session holds and the plain round-robin cursor are kept (9043a26); the dashboard round-trips the strategy in every locale (bad2f24); the pasted local policy was removed, leaving only the 24 h / 60% / 2% rule (e16415d); test-layout registration (ec58983); docs and theocxskill surface (98549e4); the generic-pool denial with HTTP 400 (1c64b10, 8361ffd); Codex weighting requires five-hour window provenance, and expired weights reset (c097bcb).Checklist
Review readiness checklist
This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:
Required local validation passed; commands, results, and any full-suite exception are documented.
I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
I resolved all correct Codex and CodeRabbit findings.
My PR is ready for review.
Readiness boxes ticked by maintainer @lidge-jun at integration (2026-11-18) after the exact-head review and CI described in the PR comments.