Composer hard-disabled by ChatGPT subscription rate limit even when model traffic is routed to a custom provider (`openai_base_url`)
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):
- #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. - #23994 — usage-limit banner despite remaining quota (Business, 0-credit seat limit).
- #10867 — custom model providers in the app; documents the frontend gating whole UI blocks on auth state (
requiresAuth). - #29156 — desktop custom providers unusable / no provider-aware model picker.
- #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.
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #48650
- #48369
Powered by Codex Action
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.
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
Confirming this issue on Windows and requesting urgent triage, as it blocks legitimate local-model workflows.
Environment: Windows x64; desktop package OpenAI.Codex 26.1120.6357.0 (app build 26.1120.50957); ChatGPT Plus; standalone Codex CLI 0.172.0; Ollama 0.40.18; local model qwen3.5:9b.
The Ollama desktop integration adds model_catalog_json and openai_base_url = "http://127.0.0.1:11434/api/codex/v1". The local model appears in the desktop model picker, but the composer remains blocked by the exhausted ChatGPT Codex allowance. Independently, the CLI using --oss --local-provider ollama -m qwen3.5:9b reached the local inference server and processed the prompt after the context window was increased. This confirms local inference is reachable despite the exhausted subscription allowance (full agent task completion not yet verified).
Additional reproduction: explicitly configuring a custom provider with the same local endpoint, wire_api = "responses" and requires_openai_auth = false, then setting it as model_provider, removed the desktop quota blocker in my test, but the normal ChatGPT chat mode disappeared. I restored the original configuration to regain chat mode.
Expected: while signed into ChatGPT, selecting an independently hosted local model should permit local tasks without losing normal ChatGPT chat mode. OpenAI-hosted models should remain subject to their existing subscription limits. Please scope composer availability to the resolved provider and preserve normal chat functionality when a local provider is configured.
Suggested regression test: exhausted Plus Codex allowance + local Ollama model selected → local prompt can be submitted; switch to an OpenAI-hosted model → applicable quota restriction remains enforced; normal ChatGPT chat remains available. Please prioritize this as a blocking desktop interoperability issue.