diff --git a/pkg/providers/cooldown.go b/pkg/providers/cooldown.go index 6811297f0..b0d8608dc 100644 --- a/pkg/providers/cooldown.go +++ b/pkg/providers/cooldown.go @@ -196,8 +196,8 @@ func calculateStandardCooldown(errorCount int) time.Duration { // 3 errors → 20 hours // 4+ errors → 24 hours (cap) func calculateBillingCooldown(billingErrorCount int) time.Duration { - const baseMs = 5 * 60 * 60 * 1000 // 5 hours - const maxMs = 24 * 60 * 60 * 1000 // 24 hours + const baseMs = 5 * 60 * 60 * 1000 // 5 hours + const maxMs = 24 * 60 * 60 * 1000 // 24 hours n := max(1, billingErrorCount) exp := min(n-1, 10) diff --git a/pkg/providers/cooldown_test.go b/pkg/providers/cooldown_test.go index e51ff40e5..47f43ad5c 100644 --- a/pkg/providers/cooldown_test.go +++ b/pkg/providers/cooldown_test.go @@ -184,7 +184,7 @@ func TestCooldown_BillingTakesPrecedence(t *testing.T) { // Standard cooldown (1 min) + billing disable (5h) ct.MarkFailure("openai", FailoverRateLimit) // 1 min cooldown - ct.MarkFailure("openai", FailoverBilling) // 5h disable + ct.MarkFailure("openai", FailoverBilling) // 5h disable // After 2 min: standard cooldown expired but billing still active *current = now.Add(2 * time.Minute)