Skip to content

[Bug]: a pool account stuck on failed credential refresh silently drops its models instead of naming the account #4212

Description

@lidge-jun

Client or integration

Other

Area

Authentication and account pool

Summary

When a pooled Codex account gets stuck on a failed credential refresh, the models it backs disappear from the model list and requests fail, but nothing names the account or the reason. The operator sees "the model is gone / unavailable through the proxy" and has to guess, and the natural conclusion is that OpenCodex broke, not that one account needs re-authentication.

Reported on X by @LjranceLi on 2026-09-10: astra and sol were both unavailable through ocx while turning the proxy off worked (https://x.com/LjranceLi/status/2097930258054025507). They then found the real cause themselves and asked for a clear indication: "It's a problem with one of my accounts: 'Codex credential refresh did not complete.' But could there be a clear indication/prompt for this?" (https://x.com/LjranceLi/status/2097934232643633636).

Expected: when an account becomes unusable, the surfaces that change because of it should say so - the model list should explain why an entitled model vanished, and the account should carry a persistent, visible health reason.

Reproduction

  1. Register two or more Codex accounts in the pool, at least one of them the only account entitled to an account-gated native model.
  2. Put that account into a state where the credential refresh keeps failing (expired or revoked refresh grant).
  3. Start the proxy and open the model list from the client.
  4. Observe that the gated models backed only by that account are no longer offered, and that the failure text at request time is a generic retry message.
  5. Observe that no surface tells you which account caused it, or that re-authentication is required.

What the source shows at dev 6d3ad12e3 (2.51.0):

  • src/codex/account-usability.ts makes the account unselectable through isAccountNeedsReauth(accountId), with no reason carried to callers.
  • src/codex/model-entitlements.ts derives gated-model availability from entitled accounts (entitledCodexAccountIdsForModel, availableAccountGatedNativeModels), so losing the last usable entitled account silently removes the model from what is advertised.
  • src/server/responses/codex-auth-error.ts:35 returns 503 server_busy with "Codex main credential refresh did not complete; retry this request", which reads as a transient server problem rather than an account that needs the operator.
  • src/server/management/oauth-account-routes.ts:280-281 already computes needsReauth and reauthReason: "refresh_failed", so the signal exists on the management side; nothing connects it to the missing model or to the request-time refusal.

Version

2.50.0 as reported ("upgraded to the latest today", 2026-09-10). Source read at dev 6d3ad12e3 (2.51.0), where the same paths are unchanged.

Operating system

Not stated by the reporter; the paths above are platform-independent.

Provider and model

codex / gpt-6-astra and codex-sol (account-gated native models)

Logs or error output

HTTP 503 server_busy
Codex credential refresh did not complete; retry this request

Screenshots and supporting files

X thread: https://x.com/LjranceLi/status/2097930258054025507

Redacted configuration

{}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

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 workingcatalogModel catalog, slugs, visibility, routed entrieslanded-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