fix(grok): 防止加权粘连回退绕过免费额度门禁

This commit is contained in:
IanShaw027
2026-08-07 13:44:56 +08:00
parent e9aaa325fa
commit 9bc99e8b6e
@@ -1248,6 +1248,12 @@ func (s *defaultOpenAIAccountScheduler) tryFallbackToWeightedSticky(
if req.RequireCompact && openAICompactSupportTier(account) == 0 {
continue
}
// Keep weighted sticky fallback subject to the same free-tier gate as the
// normal and sticky selection paths. Otherwise an over-quota free account
// could be reintroduced after the primary candidate pass.
if len(s.filterGrokFreeQuotaAccounts(ctx, []Account{*account})) == 0 {
continue
}
result, acquireErr := s.service.tryAcquireAccountSlot(ctx, account.ID, account.Concurrency)
if acquireErr != nil {
return nil, acquireErr