fix(proxies): order pool candidates by crossed short-memory health signals - #14221
Merged
diegosouzapw merged 1 commit intoSep 22, 2026
Merged
diegosouzapw merged 1 commit into
diegosouzapw merged 1 commit into
Conversation
maxmad64bis
force-pushed
the
fix/n98-rank-candidates
branch
from
September 19, 2026 22:56
f29ad4d to
69fed99
Compare
maxmad64bis
marked this pull request as ready for review
September 19, 2026 23:04
Owner
|
Thanks @maxmad64bis — merging via the release merge-train. Validated in local merge-train (mt-train10c) on the devbox @ train tip 4d841aa1c740bbaa03868dc0a403c62099a99a42 with the 72 sibling PRs of this batch: typecheck:core, file-size, complexity, cognitive-complexity, changelog-integrity green; changed-area node:test 831/831 (0 failing) and vitest 480/482 — the two reds are |
diegosouzapw
merged commit Sep 22, 2026
a204799
into
diegosouzapw:release/v3.8.51
15 of 25 checks passed
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.
Summary
A pool member that just failed keeps getting served first until it is set aside. Candidates are now ordered by crossed short-memory health signals (refusal memory plus last cached probe verdict), so a request lands on the first useful try instead of paying the failed head first. Opt-in behind
PROXY_SKIP_RECENTLY_FAILED(off by default); ordering only, nobody is removed and no status is mutated.Related Issues
Validation
npm run lint— targeted ESLint clean; full run is red on the base (same TS2677 pair, inherited, see Reviewer Notes)Tests Added Or Updated
tests/unit/proxy-pool-rank-candidates.test.ts(new, 8 cases: avoided-last, no-signal order, all-set-aside order, negative probe, first-useful-try, held sticky, canonical probe URL, flag-off identity)tests/unit/proxy-pool-skips-refused-member.test.ts(updated: final assertion reflects cursor advancing past the served member on the ranked list)Coverage Notes
src/lib/db/proxies/rotation.tscovered by the 8 new cases plus the updated neighbor; neighborsproxy-pool-rotation-6365(8/8),proxy-rotation-latency(4/4),proxy-pool-chat-path-rotation-13575+pool-ip-quota-429-path(8/8) stay green.Reviewer Notes
typecheck:coreclean, new tests 8/8, neighbors green.release/v3.8.51fails the same 9 jobs (API Route Typecheck, Docs Gates, Fast Quality Gates, Merge integrity, ESLint, Unit fast-path 1-4/4); every file cited by the failing gates is outside this diff. Non-blocking for this PR.