Skip to content

[Bug]: Codex pool can select Free account for Sol/Astra and return unsupported-model 400 #4768

Closed

Description

@snowiscold1

Client or integration

OpenCodex Codex account pool

Area

Authentication, model entitlement, and account-pool routing

Summary

When multiple Codex/ChatGPT OAuth accounts are configured in the pool, including a Plus account and Free-tier accounts, OpenCodex can select a Free account for a model that the account does not support (for example gpt-5.6-sol or gpt-6-astra). The upstream then returns:

The 'gpt-6-astra' model is not supported when using Codex with a ChatGPT account.

The request may fail instead of automatically retrying on an account that is known or discoverable to support the requested model.

Expected behavior

For account-native models whose availability differs by account/plan:

  1. Determine model entitlement per account, preferably from each account's authenticated Codex model roster.
  2. Exclude accounts that do not advertise/support the requested model before dispatch.
  3. Select an entitled account from the pool.
  4. If entitlement data is unknown, probe conservatively or provide an explicit fallback policy rather than knowingly sending the request to an ineligible account.
  5. If an eligible account is unavailable, return a clear error explaining that no configured account is entitled to the model.

For a pre-stream, exact unsupported-model 400, the existing bounded alternate-account retry should also reliably select another eligible account when one exists.

Current behavior

The native model catalog exposes flagship models globally, including gpt-6-astra, but the initial pool selection does not appear to be constrained by per-account model entitlement. A Free account can therefore be selected first for Sol/Astra and receive the upstream 400.

The source contains a special retry path for an exact unsupported-model 400, but it is conditional on pool mode, no fixed/pinned account, available retry budget, account affinity, and other routing state. In practice this does not provide deterministic entitlement-aware routing.

The native model comments also acknowledge that gpt-6-astra may be visible while a particular ChatGPT account returns an unsupported-model 400. This makes account-aware selection especially important.

Reproduction

  1. Configure two or more Codex OAuth accounts in OpenCodex:
    • one Plus account with access to Sol/Astra;
    • one Free account without access to Sol/Astra.
  2. Use pool mode without pinning the Plus account.
  3. Select codex/gpt-5.6-sol or codex/gpt-6-astra.
  4. Start requests until the Free account is selected, or observe the account in the request log.
  5. Observe the upstream unsupported-model 400 instead of deterministic selection of the entitled account.

Version

Current npm installation of @bitkyc08/opencodex; exact version should be captured by the reporter.

Operating system

Windows 11

Provider and model

Codex / ChatGPT OAuth account pool

Models affected:

  • gpt-5.6-sol
  • gpt-6-astra

Logs or error output

400
The 'gpt-6-astra' model is not supported when using Codex with a ChatGPT account.

Suggested implementation direction

  • Extend the account entitlement snapshot/cache to include flagship models such as Sol/Terra/Luna/Astra, not only currently account-gated catalog rows.
  • Add modelId filtering to the initial pool candidate selection, using the latest authenticated /codex/models roster where available.
  • Treat an authenticated roster that definitively omits a model as ineligible for that model, while distinguishing unknown/stale discovery from a confirmed denial.
  • Preserve the existing bounded retry as a safety net for rollout/shard disagreement.
  • Add tests covering Plus + Free pool selection, pinned-account behavior, stale/unknown entitlement data, exact unsupported-model 400 failover, and no eligible account.
  • Consider an opt-in configuration such as accountModelEntitlementRouting: true if the maintainers want a compatibility transition.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account emails, account IDs, and private configuration.

Related issues: #4213, #4143, #4521.

Activity

  1. added
    bugSomething isn't working
    account-poolOAuth, credentials, Codex pool, quota, failover, plans
    on Sep 16, 2026
  2. lidge-jun commented on Sep 16, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 72 / 80

    이 이슈는 Codex 풀에 Plus와 Free가 같이 있을 때 Sol/Astra(gpt-5.6-sol / gpt-6-astra) 요청이 Free로 먼저 나가 upstream unsupported-model 400을 받는다는 보고다. 현재 dev HEAD b3035fe292의 src/codex/catalog/native-models.ts(15–52행)가 그 동작을 의도적으로 설명한다. 플래그십은 ACCOUNT_GATED_NATIVE_OPENAI_MODELS에 넣지 않았다(owner 2026-09-04). 게이트 세트는 지금 gpt-daybreak-blue-latest만 있다. Astra 주석은 Free 플랜 목록에도 보이지만 계정·샤드에 따라 같은 400이 날 수 있다고 적는다.

    선택 경로도 tip과 맞다. src/codex/auth-context.ts(890–914행)는 ACCOUNT_GATED_NATIVE_OPENAI_MODELS.has(modelId)일 때만 entitlement 스냅샷을 만들고 modelEligibleAccountIds로 후보를 줄인다. Sol/Astra는 그 집합 밖이라 초기 풀 선택이 계정별 roster로 거르지 않는다. src/server/responses/core-codex-account.ts isAllowListedCodexAccountModel400(161–178행)가 정확한 unsupported-model 400 문자열을 인식하고, 같은 파일의 재시도 래더(약 660행대)는 게이트 모델 같은 계정 재시도·alternate 한 번 등에 조건이 걸린다. 안전망은 있으나 ‘처음부터 entitled 계정’을 보장하지는 않는다.

    보고자 기대(계정별 /codex/models roster로 사전 필터)는 제품적으로 타당하다. 다만 tip 주석이 이미 비용을 인정한다: roster로 가리면 미확인·타임아웃·샤드 지연이 ‘opencodex가 모델을 잃었다’로 보이고, 무조건 노출은 한 번의 400과 alternate를 감수한다. #3442 이후 질문은 공정해졌지만 답이 항상 오지는 않는다. 이 이슈는 그 트레이드오프의 풀 사용자 통증이다.

    관련 #4213(Astra 기능면), #4143(데스크톱 모델 누락), #4521(다음 계정 선택 vs 쿼타)은 겹치는 표면이 있으나 이 티켓의 핵심(초기 entitlement-aware pool selection)과는 다르다. 중복 종료보다 ‘플래그십도 roster 필터 후보로 되돌릴지’ 정책 이슈로 받는 편이 맞다. 열린 PR #4183(select account models alongside pooled native entries)가 인접할 수 있으니 착수 전 확인하라.

    Plus+Free 풀에서 Sol/Astra를 쓰는 사용자에게는 체감이 크다. 다만 현재 동작이 문서화된 의도라 ‘조용한 회귀’는 아니다. types/config 스플릿과 무관하다.

    경로 src/codex/catalog/native-models.ts (15–52) - 플래그십 비게이트 결정. Free에서 Astra 400 가능하다고 명시.
    경로 src/codex/auth-context.ts (890–914) - entitlement 후보는 게이트 모델만. Sol/Astra 초기 필터 없음.
    경로 src/server/responses/core-codex-account.ts isAllowListedCodexAccountModel400 (161–178) - 400 인식·재시도 안전망. 사전 선택은 아님.
    심볼 ACCOUNT_GATED_NATIVE_OPENAI_MODELS - tip에서 Daybreak만. Sol/Terra/Luna/Astra는 여기 없음.

    메인테이너의 판단이 필요한 지점

    • 2026-09-04 ‘플래그십 always visible’을 유지한 채 routing만 entitlement-aware로 바꿀지(카탈로그는 유지).
    • Sol/Astra를 다시 account-gated 세트에 넣을지(피커 숨김 위험).
    • opt-in accountModelEntitlementRouting 같은 호환 스위치가 필요한지.

    너의 추천
    받아라. 카탈로그 가시성은 유지하고, 풀 초기 선택만 authenticated roster로 Sol/Astra를 거르는 쪽을 추천한다(confirmed omit만 제외, unknown/stale는 보수적으로). 기존 400 alternate 재시도는 안전망으로 남겨라. #4183과 겹치면 한쪽을 닫거나 스택하라.

    이 댓글은 grok-bot이 작성했습니다

  3. lidge-jun commented on Sep 16, 2026

    @lidge-jun
    Owner

    Landed via #4797 at f35fbe8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workinglanded-via-maintainerOriginal PR closed after landing via a maintainer merge train

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions