Repository navigation
fix(sse): persisted connection cooldown wins over transient rate-limit signal - #14708
Conversation
34fb317 to
67aae29
Compare
|
Solid, well-scoped fix — the persisted cooldown genuinely should win over the transient |
…ent-persisted-precedence
Keep both file-size rebaselines (14708 persisted-cooldown + applied-proxy), co-located freetier predicate changes merged cleanly.
|
Rebased onto the current base: kept both file-size rebaselines (this PR plus the applied-proxy one) and the co-located freetier changes merged cleanly. Pre-check, tests (21), and lint re-verified on the merged tree. |
# Conflicts: # config/quality/file-size-baseline.json
638d898
into
cheaper-inference:release/v3.8.51
…act guard The guard now checks that resolveTargetTokenLimit lives only in targetTokenLimit.ts and that roundRobinCombo.ts imports it. The readCache import that the final cheaper-inference#14585 roundRobinCombo.ts carries serves the later cheaper-inference#14708 cooldown check, which this base does not have, so it is not ported.
- Latest from origin/release/v3.8.51: a58000c fix(security): pre-request hooks in isolated realm (GHSA-9p9m-h9rj-rhhg) cheaper-inference#14916 - Routing bug of interest: 96f6aee fix(routing): keep request-scoped SSE errors out of cooldowns cheaper-inference#14585 — Codex SSE errors/refusals no longer poison account cooldowns or affect other accounts - 07d2a8d fix(routing): serve sync tier from stored pricing snapshot cheaper-inference#14706 - 638d898 fix(sse): persisted connection cooldown wins over transient rate-limit signal cheaper-inference#14708 - 9c96184 fix(combo): skip connection cooldown on request-level parameter validation 400 cheaper-inference#14438 Resolved conflict on src/app/(dashboard)/dashboard/combos/page.tsx by taking upstream's import (resolveProviderAlias from providerAlias.ts), which matches upstream's downstream usage at the calling site.
Summary
A persisted per-connection cooldown (
rateLimitedUntilin the future) was bypassed whenever an in-memory transient rate-limit signal was set for the same provider: the connection was served again instead of being skipped. The persisted cooldown is now evaluated first on every dispatch path, so a connection under a future cooldown is always skipped.Related Issues
No linked issue — standalone fix verified against the current tree.
Validation
npm run lint— ESLint on the touched files is cleanupstream/release/v3.8.51at7d23bcf8ec,rev-list HEAD..base= 0; file-size/complexity/eslint/unit rerun on the merged treeTests Added Or Updated
tests/unit/combo-transient-persisted-precedence.test.ts— persisted-first ordering at the shared predicate, gate, and round-robin pre-check, frozen clock, boundary at now, plus counter-cases keeping the legitimate transient bypass.tests/unit/repro-combo-persisted-cooldown-preskip.test.ts— two assertions updated from the old transient-wins behavior to persisted-first.Coverage Notes
Covered by the tests above; no coverage gate moved down on the touched files.
Reviewer Notes
auggie.ts/projectCombo.tsand unit-shard reds reproduce identically on the bare base and the sibling PR, files outside this PR).open-sse/services/combo/roundRobinCombo.tsgrows 1263 → 1285 (+22, irreducible round-robin pre-check at the only dispatch point with no persisted check; covered by the new test): rebaseline entry_rebaseline_2026_09_24_14708_persisted_cooldown_precedenceincluded in this PR.getCachedProviderConnectionByIdimport this PR's round-robin call site needs — re-add it here if fix(routing): keep request-scoped SSE errors out of cooldowns #14585 lands first.Maintainer rework (merge-batch 2026-09-24)
release/v3.8.51into the branch (real merge, your commits kept). The only conflict wasconfig/quality/file-size-baseline.json: kept both sides' annotations, took the tip'svirtualFactory.tsceiling (1258) and kept this PR'sroundRobinCombo.tsceiling (1285, re-measured on the merged tree).getCachedProviderConnectionByIdimport that the new round-robin pre-check needs is still present after the merge.combo-transient-persisted-precedence.test.tsandrepro-combo-persisted-cooldown-preskip.test.ts; with this PR all 21 pass.typecheck:coreclean,check:open-sse-typecheck0 errors, eslint clean on the touched files,check-file-sizeOK.