sub2api
sub2api copied to clipboard
OpenAI OAuth workspace mismatch 409 repeatedly routes traffic to one account
Problem
OpenAI OAuth accounts can return HTTP 409 with sa_server_user_does_not_belong_to_workspace when the stored chatgpt-account-id workspace header does not belong to the OAuth token.
The current gateway treats this 409 as a non-failover error, returns downstream 502, and keeps selecting the same account.
Impact
Affected requests repeatedly hit the same account and generate avoidable upstream traffic.
Proposed Fix
- Detect only this specific workspace mismatch for OpenAI OAuth accounts.
- Retry once without
chatgpt-account-id. - If the retry still fails, temporarily block the account and fail over to another account.
- Leave unrelated 409 responses unchanged.
Observed on /v1/responses with account-specific failures.
修复已提交 PR #4786:首次 workspace mismatch 409 自动去掉 chatgpt-account-id 重试;仍失败则暂停账号并切换调度。已基于最新 main 验证。