sub2api icon indicating copy to clipboard operation
sub2api copied to clipboard

OpenAI OAuth workspace mismatch 409 repeatedly routes traffic to one account

Open superman2003 opened this issue 4 months ago • 1 comments

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.

superman2003 avatar Jul 23 '26 11:07 superman2003

修复已提交 PR #4786:首次 workspace mismatch 409 自动去掉 chatgpt-account-id 重试;仍失败则暂停账号并切换调度。已基于最新 main 验证。

superman2003 avatar Jul 23 '26 12:07 superman2003