diff --git a/config.example.yaml b/config.example.yaml index 786f14559..7fc01bea6 100644 --- a/config.example.yaml +++ b/config.example.yaml @@ -167,7 +167,7 @@ disable-cooling: false save-cooldown-status: false # Cooldown duration in seconds for transient upstream errors (408/500/502/503/504). -# Set to 0 to keep the legacy 60-second cooldown; set to -1 to disable transient error cooldowns. +# Set to 0 to keep the legacy 10-second cooldown; set to -1 to disable transient error cooldowns. transient-error-cooldown-seconds: 0 # When true, globally disable Claude request cloaking (the Claude Code CLI disguise and diff --git a/sdk/cliproxy/auth/conductor_overrides_test.go b/sdk/cliproxy/auth/conductor_overrides_test.go index 17026efb1..4b8dc773e 100644 --- a/sdk/cliproxy/auth/conductor_overrides_test.go +++ b/sdk/cliproxy/auth/conductor_overrides_test.go @@ -946,8 +946,8 @@ func TestManager_MarkResult_TransientErrorCooldownDefault(t *testing.T) { t.Fatal("expected transient error cooldown to keep the legacy default") } diff := time.Until(state.NextRetryAfter) - if diff < 55*time.Second || diff > 65*time.Second { - t.Fatalf("expected transient error cooldown to be ~60 seconds, got %v", diff) + if diff < 5*time.Second || diff > 15*time.Second { + t.Fatalf("expected transient error cooldown to be ~10 seconds, got %v", diff) } } diff --git a/sdk/cliproxy/auth/conductor_refresh.go b/sdk/cliproxy/auth/conductor_refresh.go index 3ee7247b2..432181ba6 100644 --- a/sdk/cliproxy/auth/conductor_refresh.go +++ b/sdk/cliproxy/auth/conductor_refresh.go @@ -32,7 +32,12 @@ const ( refreshIneffectiveBackoff = 30 * time.Second quotaBackoffBase = time.Second quotaBackoffMax = 30 * time.Minute - transientErrorCooldown = time.Minute + // transientErrorCooldown is the default for 408/500/502/503/504 transient + // errors and the fallback enforced cooldown for request-scoped + // stop-and-cooldown / continue-and-cooldown rules. The latter use this + // constant directly and do not consult the transient-error-cooldown-seconds + // knob. + transientErrorCooldown = 10 * time.Second ) // StartAutoRefresh launches a background loop that evaluates auth freshness