fix(sse): limit exploitation to equivalent candidates - #11420
jacobsparts wants to merge 2 commits into
Conversation
Normal exploitation could rotate into a materially lower-scored tier even when exploration was disabled. Restrict its rotation pool to candidates within one normalized score point of the winner, preserving load balancing across equivalent connections while leaving explicit exploration and budget fallback unchanged.
|
Obrigado por revisar após o #11406 — esta versão é bem mais cuidadosa e resolve minha objeção principal: o round-robin por conexão ( O motivo: Se o objetivo é impedir que a exploração normal escolha um candidato "materialmente pior" quando os scores estão bem próximos, talvez o ajuste certo seja no |
|
Thanks for the feedback and for walking through the tier preference behavior. The suggested direction sounds right, will give it another shot with that in mind. |
Problem
With exploration disabled, Auto-Combo could still rotate from the highest-scored candidate into a materially lower-scored tier. In simple terms, the scoring engine identified the better target and ordinary exploitation then discarded that result.
This is a narrower replacement for #11406. It does not remove
ScoreTierRotatoror concentrate all traffic on one connection. Candidates whose normalized scores are within one point (0.01) of the winner remain in the rotation pool, preserving load balancing across equivalent providers and connection IDs.Summary
0.01of the best scoreThe boundary is evidence-based in the regression fixtures: the existing intended smart rotation spans a
0.005621score gap, while the reproduced incorrect lower-tier choice has a0.027147gap.Tests
release/v3.8.50npx vitest run --config vitest.mcp.config.ts tests/unit/autoCombo/tieredRotation.test.ts— 12 passednode --import tsx/esm --import ./open-sse/utils/setupPolyfill.ts --import ./tests/_setup/isolateDataDir.ts --test --test-force-exit tests/unit/auto-combo-engine.test.ts— 4 passedgit diff --check— passednpm run check:known-symbols— passedRepository-wide lint is currently blocked by inherited base-red issue #9985; the changed files pass the repository's suppression-aware focused lint.
Scope
Production code changes are limited to
open-sse/services/autoCombo/engine.ts; the focused regression is intests/unit/autoCombo/tieredRotation.test.ts.