From 7a618ed5d3d3cd93065b0e1ca7e43e0809ff4a03 Mon Sep 17 00:00:00 2001 From: warelik Date: Fri, 21 Aug 2026 18:22:39 +0300 Subject: [PATCH 1/2] fix(auth): lower transient error cooldown default to 10s A single 5xx/408 transient blip was sidelining genuinely-live accounts and models for a full minute. Lower the legacy fallback from 60s to 10s, keep the transient-error-cooldown-seconds knob configurable, and update the example config and the matching default-cooldown test. --- config.example.yaml | 2 +- sdk/cliproxy/auth/conductor_overrides_test.go | 4 ++-- sdk/cliproxy/auth/conductor_refresh.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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..5f364be05 100644 --- a/sdk/cliproxy/auth/conductor_refresh.go +++ b/sdk/cliproxy/auth/conductor_refresh.go @@ -32,7 +32,7 @@ const ( refreshIneffectiveBackoff = 30 * time.Second quotaBackoffBase = time.Second quotaBackoffMax = 30 * time.Minute - transientErrorCooldown = time.Minute + transientErrorCooldown = 10 * time.Second ) // StartAutoRefresh launches a background loop that evaluates auth freshness From 07edc9367d09aa61d4dd1805b1bebe0c6a4d3efc Mon Sep 17 00:00:00 2001 From: warelik Date: Fri, 21 Aug 2026 18:36:47 +0300 Subject: [PATCH 2/2] docs(auth): document force-cooldown use of transientErrorCooldown Add a code-level comment noting that transientErrorCooldown also backs the ErrorCodeForceCooldown fallbacks for request-scoped stop-and-cooldown / continue-and-cooldown rules, and that those paths use the constant directly without consulting the transient-error-cooldown-seconds knob. --- sdk/cliproxy/auth/conductor_refresh.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sdk/cliproxy/auth/conductor_refresh.go b/sdk/cliproxy/auth/conductor_refresh.go index 5f364be05..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 = 10 * time.Second + // 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