Skip to content

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

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

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