Repository navigation
Description
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:
ncomes from the ChatGPT backend, not from the configured provider.Nfis a query atom overGET /wham/usageon the ChatGPT side, keyed['rate-limit-status', userId, accountId]. Nothing in the predicate referencesopenai_base_url, the provider, or the catalog.- The block is keyed off auth identity, not routing. The gate requires
authMethod === 'chatgpt', whereauthMethodis 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 custombase_urlwhen 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?
- 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"
- Sign in to the desktop app with a ChatGPT plan account (Plus), so
authMethod === 'chatgpt'. - Exhaust the Codex usage allowance for that account (5-hour and/or weekly window reaching 0%).
- Open or create a Codex thread in the desktop app on the local host.
- 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"). - In a terminal, run
codexwith the same~/.codex/config.tomland 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 onauthMethod+hostId === 'local'). - Treat an exhausted subscription allowance as advisory (banner / warning) rather than
submitDisabledwhenever 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):
- Codex Desktop shows “You're out of Codex messages” despite 99% usage remaining #24445 — desktop shows an out-of-messages state from an empty
account/rateLimits/readsnapshot while quota remains. Same "desktop rate-limit classification is wrong" failure mode. - Codex App shows usage limit reached despite remaining 5-hour and weekly quota #23994 — usage-limit banner despite remaining quota (Business, 0-credit seat limit).
- Support custom model providers in app #10867 — custom model providers in the app; documents the frontend gating whole UI blocks on auth state (
requiresAuth). - Desktop custom providers are unusable with existing chats and the model picker #29156 — desktop custom providers unusable / no provider-aware model picker.
- Codex desktop: switching an existing thread to a custom API provider can break continuity and remote compact still hits api.openai.com #38930 — switching an existing thread from ChatGPT-plan auth to a custom Responses-compatible provider is fragile.
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
github-actions commentedon Sep 27, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
vhicktour commentedon Oct 20, 2026
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):Both send gates in the shipped bundle are the same as described above. The composer atom and the host
hardBlockedvalue still read only the ChatGPT usage payload (rate_limit.allowed === false), and neither checksopenai_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.doer-ee commentedon Nov 21, 2026
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/usagehasrate_limit.allowed === falseand no credits. It does not readmodel_provideroropenai_base_url, which matches your observation that the same config works in the CLI.Setting
rate_limit.allowed = truein the page (and clearing the server'srate_limit_upsell/rate_limit_reached_typefor 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