win a2ab67f8c7 feat(scheduler): add P2C + quota-aware scheduling for OpenAI accounts
- Add GetQuotaRemainingFraction() to Account: returns [0,1] fraction of
  remaining quota; 1.0 when no limit is configured (unlimited accounts)
- Add Quota float64 weight field to GatewayOpenAIWSSchedulerScoreWeights
  and EnableP2CScheduling bool to GatewayOpenAIWSConfig (both default off)
- Extend selectByLoadBalance scoring with quota factor (gated by Quota>0)
- Add selectByPowerOfTwo(): O(1) P2C selection — samples 2 random candidates,
  tries the better-scored one first then the other, falls back to wait plan;
  activated when EnableP2CScheduling=true
- Add openAIWSP2CEnabled() helper on OpenAIGatewayService
- Add 6 tests covering quota fraction edge cases, P2C toggle, weight defaults,
  single-candidate P2C, two-candidate P2C selection, and quota score ordering
2026-04-29 03:13:30 +08:00
..