Skip to content

fix(proxy-health): skip sweep probes already proven by recent production successes - #14805

Merged
diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.52from
maxmad64bis:fix/passive-proxy-health
Oct 6, 2026
Merged

diegosouzapw merged 1 commit into
cheaper-inference:release/v3.8.52from
maxmad64bis:fix/passive-proxy-health

Conversation

@maxmad64bis

@maxmad64bis maxmad64bis commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ base-red inherited: #15306

Summary

Opt-in, default unchanged: with PROXY_HEALTH_PASSIVE_SKIP unset (default false) the sweep probes every proxy exactly as before. When enabled, the background sweep stops re-probing an endpoint that recent single-provider production successes already prove alive, so it sends fewer probes. Only an attributed proxy failure keeps the live probe, so confirmed failures still feed auto-disable and auto-remove.

Related Issues

Validation

  • Change type: routing
  • Focused tests and category gates from the golden path
  • npm run lint
  • Reconciled with the current active release base; focused checks rerun afterward
  • Production-code changes include a new or updated automated test in this PR

Tests Added Or Updated

  • tests/unit/proxy-health-passive-verdict.test.ts: veto on any attributed failure in either order, rewritten from the inverted order.
  • tests/unit/proxy-health-passive-sweep.test.ts (7 cases): healthy skip, kept probe, flag off, multi-provider guard, counted apart.
  • tests/unit/proxy-health-passive-traffic.test.ts (2 mixed cases): real logger → storage → sweep, [fail, ok] and [ok, fail] both keep the probe.

Coverage Notes

  • src/lib/proxyHealth/passiveVerdict.ts: proxy-health-passive-verdict.test.ts, plus the real logger path in proxy-health-passive-traffic.test.ts.
  • src/lib/proxyHealth/scheduler.ts: proxy-health-passive-sweep.test.ts (skip, kept probe, flag off, promotion beside a skip).

Reviewer Notes

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Thanks — using production traffic to skip redundant probes is a sensible idea and the pure passiveVerdict module is easy to test. Three requests: (1) with recent traffic this changes default sweep behavior, so please put it behind an opt-in flag (or call it out explicitly); (2) TLS/DNS/fetch failed are broad enough to blame the provider or network on the proxy — can we tighten them? (3) it conflicts with #14776 in scheduler.ts, so please rebase once that one lands.

@diegosouzapw diegosouzapw added the deferred-v3.8.52 Grande demais / suspeito para o lote atual; precisa de sessão dedicada no ciclo v3.8.52 label Sep 25, 2026
@diegosouzapw diegosouzapw changed the title feat(proxy-health): skip sweep probes from recent production traffic [defer] feat(proxy-health): skip sweep probes from recent production traffic Sep 25, 2026
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Heads-up: #14776 landed on release/v3.8.51 and also rewrote src/lib/proxyHealth/scheduler.ts, so this PR now conflicts. It needs a rebase onto the tip that keeps both behaviors. Tracking in #14852.

diegosouzapw pushed a commit that referenced this pull request Sep 25, 2026
Maintainer rework: reconciled with release/v3.8.51 — scheduler.ts re-applied on the tip's two-phase sweep (#14805: verdict recorded in decideOneResult from the final, possibly promoted, outcome; dropped on auto-remove); ProxyHealthCell/proxyRegistryConstants keep the tip's transport/upstream fields plus the sweep verdict. Locales: tip keys + only proxyRegistry.sweepVerdict/sweepNoData/sweepLabel.* (nested), no reorder, no __MISSING__. Tests: sweep-verdict + route 13/13, proxy-health scheduler suites 55/55 on tip+head, UI vitest 3/3; typecheck:core clean; i18n ratio/new-keys PASS (check-keys only reports the tip's inherited bs requestTimeline gap); file-size only the inherited opencode.ts tip ceiling. Thank you @maxmad64bis!
@maxmad64bis

maxmad64bis commented Sep 26, 2026 •

Copy link
Copy Markdown
Contributor Author

#14852 Done — all three requests addressed: opt-in flag PROXY_HEALTH_PASSIVE_SKIP (off by default), tightened attribution to bounded syscall codes, and rebase onto the tip keeping both sweep behaviors (scheduler.ts conflict-free, proxy-health* suites green on tip and after).

@maxmad64bis
maxmad64bis force-pushed the fix/passive-proxy-health branch from c94b95c to 4745660 Compare September 28, 2026 12:08
@maxmad64bis maxmad64bis changed the title [defer] feat(proxy-health): skip sweep probes from recent production traffic [defer] feat(proxy-health): skip sweep probes already proven by recent production successes Sep 28, 2026
@maxmad64bis
maxmad64bis force-pushed the fix/passive-proxy-health branch from 4745660 to 917f669 Compare September 28, 2026 17:56
@diegosouzapw
diegosouzapw changed the base branch from release/v3.8.51 to release/v3.8.52 September 29, 2026 11:20
@diegosouzapw

Copy link
Copy Markdown
Collaborator

Re-homed to release/v3.8.52: v3.8.51 entered its release freeze, so the branch now belongs to the release captain and development continues on the next cycle. Nothing is wrong with this PR — it just needed a live base. No action needed from you; CI will re-run against the new base.

@diegosouzapw diegosouzapw removed the deferred-v3.8.52 Grande demais / suspeito para o lote atual; precisa de sessão dedicada no ciclo v3.8.52 label Oct 1, 2026
@diegosouzapw diegosouzapw changed the title [defer] feat(proxy-health): skip sweep probes already proven by recent production successes feat(proxy-health): skip sweep probes already proven by recent production successes Oct 1, 2026
@maxmad64bis
maxmad64bis marked this pull request as draft October 1, 2026 22:35
@maxmad64bis
maxmad64bis force-pushed the fix/passive-proxy-health branch from 917f669 to 3f6bc9f Compare October 2, 2026 00:32
@maxmad64bis
maxmad64bis marked this pull request as ready for review October 2, 2026 09:02
@maxmad64bis
maxmad64bis force-pushed the fix/passive-proxy-health branch from 3f6bc9f to 3394632 Compare October 2, 2026 15:08
@maxmad64bis maxmad64bis changed the title feat(proxy-health): skip sweep probes already proven by recent production successes fix(proxy-health): skip sweep probes already proven by recent production successes Oct 2, 2026
@maxmad64bis
maxmad64bis force-pushed the fix/passive-proxy-health branch from 3394632 to 851ccc2 Compare October 4, 2026 12:37
…ion successes

Opt-in (PROXY_HEALTH_PASSIVE_SKIP, default off): the proxy health sweep skips the live probe of an endpoint already proven by recent single-provider production successes; a recent attributed failure keeps its probe so auto-disable/auto-remove still apply.
@maxmad64bis
maxmad64bis force-pushed the fix/passive-proxy-health branch from 851ccc2 to 96ed7fc Compare October 4, 2026 13:10
@diegosouzapw
diegosouzapw merged commit 759ab84 into cheaper-inference:release/v3.8.52 Oct 6, 2026
81 of 105 checks passed
@maxmad64bis
maxmad64bis deleted the fix/passive-proxy-health branch October 7, 2026 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants