@@ -993,8 +993,10 @@ func (s Server) withRequestTimeExhaustionWindows(statuses []AccountUsageStatus)
993993 }
994994 name := "request-limit"
995995 windowSeconds := int64 (7 * 24 * 60 * 60 )
996+ feature := ""
996997 if status .Provider == accounts .ProviderClaude {
997- name = "oauth-apps-weekly"
998+ name = agentclaude .FableWindowName
999+ feature = agentclaude .FableModel
9981000 }
9991001 if usageWindowNamed (status .Windows , name ) {
10001002 continue
@@ -1004,6 +1006,7 @@ func (s Server) withRequestTimeExhaustionWindows(statuses []AccountUsageStatus)
10041006 UsedPercent : 100 ,
10051007 LimitWindowSeconds : windowSeconds ,
10061008 ResetAfterSeconds : resetAfter ,
1009+ Feature : feature ,
10071010 })
10081011 }
10091012 return out
@@ -1374,7 +1377,9 @@ func fetchAccountUsageWindowsLive(ctx context.Context, client *http.Client, acco
13741377 windows := claudeUsageWindows (usage )
13751378 if ! usageWindowNamed (windows , agentclaude .FableWindowName ) {
13761379 if fableWindows , probeErr := agentclaude .FetchFableUsageWindows (ctx , client , account .Token ); probeErr == nil && len (fableWindows ) > 0 {
1377- windows = mergeUsageWindows (windows , fableWindows )
1380+ if err == nil || fableProbeHasPrimaryWindows (fableWindows ) {
1381+ windows = mergeUsageWindows (windows , fableWindows )
1382+ }
13781383 } else if err != nil {
13791384 if probeErr != nil {
13801385 return nil , probeErr
@@ -1390,6 +1395,15 @@ func fetchAccountUsageWindowsLive(ctx context.Context, client *http.Client, acco
13901395 return accounts .FetchCodexUsage (ctx , client , account )
13911396}
13921397
1398+ func fableProbeHasPrimaryWindows (windows []accounts.UsageWindow ) bool {
1399+ for _ , window := range windows {
1400+ if window .Name == "5h" || window .Name == "7d" {
1401+ return true
1402+ }
1403+ }
1404+ return false
1405+ }
1406+
13931407func mergeUsageWindows (base , extra []accounts.UsageWindow ) []accounts.UsageWindow {
13941408 out := append ([]accounts.UsageWindow (nil ), base ... )
13951409 index := make (map [string ]int , len (out ))
0 commit comments