From 9bc99e8b6eb62767172c22a6b832f1208b5c8fec Mon Sep 17 00:00:00 2001 From: IanShaw027 Date: Fri, 7 Aug 2026 13:44:56 +0800 Subject: [PATCH] =?UTF-8?q?fix(grok):=20=E9=98=B2=E6=AD=A2=E5=8A=A0?= =?UTF-8?q?=E6=9D=83=E7=B2=98=E8=BF=9E=E5=9B=9E=E9=80=80=E7=BB=95=E8=BF=87?= =?UTF-8?q?=E5=85=8D=E8=B4=B9=E9=A2=9D=E5=BA=A6=E9=97=A8=E7=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/service/openai_account_scheduler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/internal/service/openai_account_scheduler.go b/backend/internal/service/openai_account_scheduler.go index 84e79f7afe..f39a38dbd8 100644 --- a/backend/internal/service/openai_account_scheduler.go +++ b/backend/internal/service/openai_account_scheduler.go @@ -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