mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 16:07:33 +00:00
When an OpenAI upstream sheds capacity (`server_is_overloaded` / `slow_down`) and advertises an explicit `Retry-After` longer than the per-retry delay cap (8s, e.g. 315-369s in #9183), replaying a single-credential account every 8s cannot satisfy the upstream window and delays switching to healthy accounts. Switch non-pool accounts immediately on long capacity-shed `Retry-After` hints while keeping short/unspecified blips and pool-mode relays retryable, preserve request-scoped transient semantics (no persistent account cooldown), and log `upstream_retry_after` on retry and switch events. Fixes #9183 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>