Skip to content

Composer hard-disabled by ChatGPT subscription rate limit even when model traffic is routed to a custom provider (openai_base_url) #48816

Open

Description

@rwflan

What version of the Codex App are you using (From "About Codex" dialog)?

26.924.22138 (build 11645), macOS. Bundled app-server: codex-cli 0.158.0-alpha.2.1.

What subscription do you have?

ChatGPT Plus (auth_mode: chatgpt in ~/.codex/auth.json, chatgpt_plan_type: plus).

What platform is your computer?

$ uname -mprs
Darwin 27.0.0 arm64 arm

macOS 27.0 (26A428), Mac14,3 (M2, 16 GB).

What issue are you seeing?

When the ChatGPT Plus subscription's Codex usage allowance is exhausted, the desktop app hard-disables the composer — the send button greys out and the tooltip reads "Messages limit reached" — even in conversations whose model requests are not being served by that subscription.

I route model traffic to a custom OpenAI-compatible endpoint using the documented shared ~/.codex/config.toml:

model = "gpt-6-luna"
openai_base_url = "http://127.0.0.1:4202/v1"
model_catalog_json = "/Users/raymondflanagan/.codex/codex-router/merged-models.json"

The same config works fine in the Codex CLI. In the desktop app, exhausting the Plus allowance disables the composer for local threads even though the local runtime would be talking to 127.0.0.1:4202, not to the rate-limited subscription.

The UI's decision appears to be derived solely from the ChatGPT account's usage payload and never consults openai_base_url, the configured model provider, or the model catalog. The result is that the app blocks a conversation it is in fact able to serve.

From the shipped renderer bundle (Contents/Resources/app.asar → /webview/assets/app-primary-cca0c1a58f0f.js), the chain is:

// ~2676548 — Codex composer adapter
nn = Q(aA) && ht === `local`,
// ~2681339
let Mn = De || Qe && $e || pt || xt || Jt?.isLoading === !0 || _t || nn,
// ~2683270 — passed to the composer as a prop
jsx(ft, { ..., submitDisabled: Mn, ... })

where aA is the "ChatGPT subscription is rate limited" atom (~165947):

aA = Co($, ({ get: e }) => {
  let t = e(Am), n = e(Nf).data;
  if (t.authMethod !== `chatgpt` || t.authLoading || t.accountLoading ||
      t.authenticatedAccountId == null || t.accountId !== t.authenticatedAccountId ||
      n?.account_id !== t.authenticatedAccountId || n.user_id !== t.userId ||
      n.plan_type !== t.plan || n.rate_limit?.allowed !== false ||
      jje(n) ||
      p_e({ rateLimitStatus: n, isWorkspaceAccount: t.accountStructure === `workspace` }) ||
      e(zS, `local`)) return false;
  ...
})

Two observations that seem like the core of the problem:

  1. n comes from the ChatGPT backend, not from the configured provider. Nf is a query atom over GET /wham/usage on the ChatGPT side, keyed ['rate-limit-status', userId, accountId]. Nothing in the predicate references openai_base_url, the provider, or the catalog.
  2. The block is keyed off auth identity, not routing. The gate requires authMethod === 'chatgpt', where authMethod is derived from what the app-server reports for the account (account.type === 'apiKey' → 'apikey', === 'chatgpt' → 'chatgpt'). So the same binary will send happily over a custom base_url when signed in with an API key, and refuse when signed in with a ChatGPT plan — even though the request path is identical in both cases.

There is a second, independent hard block in the same expression that is easy to miss: _t is zAn.hardBlocked for the resolved host, so submitDisabled is ... || _t || nn. The ChatGPT conversation surface has its own parallel gate (gt = Q(aA) && tt → rateLimitSendBlocked: Mr || gt).

I also looked for a supported way to override this short of patching, and found none: the bail-out atoms in the predicate (zS, vDe/fPe) are read-only derived families or in-memory signal families with no writer reachable from config, localStorage/IndexedDB, IPC, or the app-server — vDe/fPe have exactly one call site, gated behind a completed codex_weekly purchase.

What steps can reproduce the bug?

  1. Configure a custom OpenAI-compatible provider in ~/.codex/config.toml:
    model = "gpt-6-luna"
    openai_base_url = "http://127.0.0.1:4202/v1"
    model_catalog_json = "/Users/raymondflanagan/.codex/codex-router/merged-models.json"
  2. Sign in to the desktop app with a ChatGPT plan account (Plus), so authMethod === 'chatgpt'.
  3. Exhaust the Codex usage allowance for that account (5-hour and/or weekly window reaching 0%).
  4. Open or create a Codex thread in the desktop app on the local host.
  5. Observe: the composer is disabled, the send button is greyed, and hovering shows the tooltip Messages limit reached (chatgptConversations.composer.rateLimitHardBlock.tooltip, "Messages limit reached").
  6. In a terminal, run codex with the same ~/.codex/config.toml and send a message — it is served normally by the custom endpoint.

Session id / token usage / context window: not applicable; the prompt is never submitted, so no turn is created and no quota is consumed.

What is the expected behavior?

The composer should remain usable when the model/provider serving the thread is not the rate-limited subscription. Concretely, one of:

  • Scope the subscription rate-limit block to threads that will actually be served by the ChatGPT subscription (i.e. gate on the resolved provider / openai_base_url, not just on authMethod + hostId === 'local').
  • Treat an exhausted subscription allowance as advisory (banner / warning) rather than submitDisabled whenever a non-subscription provider is configured, and let the request fail server-side if the assumption is wrong.
  • At minimum, keep the model picker usable while blocked so the user can switch to a provider that still has capacity — currently the whole composer is inert.

Additional information

This looks like the same underlying class as a few existing reports, but I could not find one covering this specific combination (subscription limit reached and model traffic routed elsewhere):

One workaround I did confirm: signing in with an API key makes authMethod !== 'chatgpt', which short-circuits the predicate to false and unblocks the composer on every surface. I mention it because it demonstrates the block tracks auth identity rather than request routing, but it costs the ChatGPT-plan features (cloud tasks, the /wham/usage UI, the ChatGPT conversation surface), so it isn't a real fix.

No session id: the block prevents submission, so no turn is ever created.

Activity

  1. added
    bug
    app
    custom-model
    rate-limits
    on Sep 27, 2026
  2. github-actions commented on Sep 27, 2026

    @github-actions
    Contributor
  3. vhicktour commented on Oct 20, 2026

    @vhicktour

    Still happens in 26.1013.40934 (build 20770) on macOS 27.0.1, Plus plan. Model traffic goes to Ollama's built-in Codex router (ollama launch codex):

    openai_base_url = "http://127.0.0.1:11434/api/codex/v1"

    Both send gates in the shipped bundle are the same as described above. The composer atom and the host hardBlocked value still read only the ChatGPT usage payload (rate_limit.allowed === false), and neither checks openai_base_url, the provider or the model catalog. The same Ollama endpoint answers requests fine outside the app. Signing in with an API key still clears both gates.

  4. doer-ee commented on Nov 21, 2026

    @doer-ee

    Still reproducible on macOS 26.1117.31558 with a custom provider. The lock is the "usage-limit" reason, which is true when the signed-in account's /wham/usage has rate_limit.allowed === false and no credits. It does not read model_provider or openai_base_url, which matches your observation that the same config works in the CLI.

    Setting rate_limit.allowed = true in the page (and clearing the server's rate_limit_upsell / rate_limit_reached_type for the banner) re-enables sending, so the gate is client-side only. Write-up: https://doer.ee/blog/ai/codex-desktop-locked-after-chatgpt-quota-with-a-custom-provider

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

    appbugcustom-modelrate-limits

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions