mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-24 16:05:44 +08:00
OpenAI OAuth (ChatGPT) accounts deterministically reject plan-gated models with 400 "The 'X' model is not supported when using Codex with a ChatGPT account". Account selection had no capability filtering for this, so the scheduler kept picking the same account for the same model forever; every attempt burned an upstream call and surfaced to clients as a retryable 502, sustaining client retry storms. Treat this 400 like upstream model-not-found: mark the (account, model) pair via SetModelRateLimit (30min cooldown) so IsSchedulableForModelWithContext skips the account for that model during selection, and return true so the in-flight request fails over to another account through the existing UpstreamFailoverError path.