feat(strategy): add quota-awareness to hybrid account selection

The hybrid strategy now considers account quota levels when selecting
accounts, preventing any single account from being drained to 0%.

- Add QuotaTracker class to track per-account quota levels
- Exclude accounts with critical quota (<5%) from selection
- Add quota component to scoring formula (weight: 3)
- Fall back to critical accounts when no alternatives exist
- Add 18 new tests for quota-aware selection

Scoring formula: Health×2 + Tokens×5 + Quota×3 + LRU×0.1

An attempt at resolving  badrisnarayanan/antigravity-claude-proxy#171
This commit is contained in:
jgor20
2026-01-21 11:15:38 +00:00
parent e51e3ff56a
commit 2f5babba99
5 changed files with 422 additions and 7 deletions

View File

@@ -6,3 +6,4 @@
export { HealthTracker } from './health-tracker.js';
export { TokenBucketTracker } from './token-bucket-tracker.js';
export { QuotaTracker } from './quota-tracker.js';