Skip to content

fix: add bounds checking to proxy tier prediction#1824

Closed
vdusek wants to merge 1 commit intomasterfrom
fix/proxy-tier-bounds-checking
Closed

fix: add bounds checking to proxy tier prediction#1824
vdusek wants to merge 1 commit intomasterfrom
fix/proxy-tier-bounds-checking

Conversation

@vdusek
Copy link
Copy Markdown
Collaborator

@vdusek vdusek commented Mar 30, 2026

Summary

  • Add bounds clamping in _ProxyTierTracker.predict_tier() to prevent negative or out-of-bounds tier index that could cause IndexError on proxy selection
  • Normalize stored tier on entry and clamp after adjustment, using a cached max_tier local

Test plan

  • Added test_predict_tier_bounds_with_single_tier to verify tier stays at 0 across repeated calls with a single-tier config
  • All existing proxy tier tests pass

🤖 Generated with Claude Code

Prevent negative or out-of-bounds tier index in _ProxyTierTracker.predict_tier()
which could cause IndexError on next proxy selection.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Mar 30, 2026
@vdusek vdusek self-assigned this Mar 30, 2026
@github-actions github-actions bot added this to the 137th sprint - Tooling team milestone Mar 30, 2026
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Mar 30, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.24%. Comparing base (5b28f03) to head (a3890a6).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1824      +/-   ##
==========================================
- Coverage   92.25%   92.24%   -0.01%     
==========================================
  Files         157      157              
  Lines       10886    10889       +3     
==========================================
+ Hits        10043    10045       +2     
- Misses        843      844       +1     
Flag Coverage Δ
unit 92.24% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
Copy link
Copy Markdown
Collaborator Author

vdusek commented Mar 30, 2026

not a bug

@vdusek vdusek closed this Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants