GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug]: Codex limits vanish when openai_base_url points to a local pass-through proxy · Issue #35186 · pingdotgg/t3code

[Bug]: Codex limits vanish when openai_base_url points to a local pass-through proxy #35186

New issue
Copy link
New issue
Copy link
Open
#37646
Open
[Bug]: Codex limits vanish when openai_base_url points to a local pass-through proxy#35186
#37646
Copy link

Description

@spklk
spklk
opened on Nov 12, 2026
Issue body actions

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Sign Codex in with a ChatGPT subscription (codex login).
  2. Route Codex through a local pass-through proxy that forwards to OpenAI. For example, put this in ~/.codex/config.toml (Headroom's Codex integration writes exactly this):
    model_provider = "openai"
    openai_base_url = "http://127.0.0.1:6767/v1"
  3. Open Usage → Limits in T3 Code.

Expected behavior

The Codex Session and Weekly limits show. The proxy only forwards traffic, so every request still spends the signed-in ChatGPT account's quota. account/rateLimits/read on the same codex app-server returns that quota normally.

Actual behavior

Codex has no limits in Usage → Limits. The provider snapshot stores usageLimits: { windows: [], unavailable: { reason: "unsupported" } }. Claude limits still show, even though Claude goes through the same proxy via ANTHROPIC_BASE_URL.

The cause is routesToNativeOpenai from #18622 (c9dfc40). It counts a route as native only when openai_base_url is unset or is https://api.openai.com or https://chatgpt.com. Any other URL makes codexRoutesSpendNativeQuota return false, so the probe skips account/rateLimits/read and publishes unsupported. Because unsupported snapshots also reject streamed limits, nothing brings them back.

Before #18622 the probe read rate limits whatever the base URL was, so this setup worked. It is a regression for loopback proxies in front of OpenAI.

Commenting out the openai_base_url line, with nothing else changed, brings the limits back on the next provider re-check.

Replaying T3's probe sequence (initialize → account/read → config/read → gate → account/rateLimits/read) against codex app-server:

openai_base_url account.type requiresOpenaiAuth gate account/rateLimits/read
http://127.0.0.1:6767/v1 chatgpt true false returns primary and secondary windows
unset chatgpt true true returns the same windows

Codex returns the quota either way; only T3's gate differs.

Possible directions:

  • Let the user mark a custom openai_base_url as a pass-through to native OpenAI, per provider instance.
  • Or treat loopback base URLs with a chatgpt account as native, and read rate limits when account/rateLimits/read returns an accountId that matches the signed-in account. That keeps fix(server): custom Codex providers no longer report native quota #18622's protection for routes to other providers.

Related, not duplicates: #11515, #23054.

Impact

Minor bug or occasional failure

Version or commit

0.1.10-nightly.20261112.4580 (first affected nightly: 0.1.10-nightly.20261111.4529; 0.1.9-nightly.20261111.4515 is fine)

Environment

macOS, T3 Code desktop (Nightly), codex-cli 0.167.2, ChatGPT-subscription Codex login, local pass-through proxy on 127.0.0.1

Logs or stack traces

# Cached Codex provider snapshot with the proxy line present
usageLimits: {"windows": [], "unavailable": {"reason": "unsupported"}}

# Same snapshot about 30 s after commenting out openai_base_url (no restart)
usageLimits.windows: [("Session", 0), ("Weekly", 30)]

Workaround

Remove openai_base_url from the Codex config. This takes Codex off the proxy.

Reacted by Lucas, kazv and nick0504k-bot

Activity

  1. hkucukler commented on Nov 12, 2026

    @hkucukler
    hkucukler
    on Nov 12, 2026 – with ChatGPT Codex Connector
    More actions

    Also seeing this on Windows with codex-chatgpt-web. Codex returns the limits, but T3 doesnt show them.

  2. Murtatrxx commented on Nov 12, 2026

    @Murtatrxx
    Murtatrxx
    on Nov 12, 2026
    More actions

    repro on Windows with T3 Code desktop 0.1.10-nightly.20261112.4580, Codex CLI 0.167.2, and two enabled ChatGPT Plus provider instances using separate CODEX_HOME directories. Both use codex-chatgpt-web, which configures a loopback openai_base_url in each home. The default Codex instance is disabled; both added instances authenticate and run, but Usage → Limits shows no providers reporting subscription limits.

    For each home, I started codex app-server and queried account/read, config/read, and account/rateLimits/read directly. Both returned account.type = chatgpt, requiresOpenaiAuth = true, the loopback base URL, and a codex rate-limit snapshot with primary and secondary windows. T3's native-route gate rejects that URL before making the usage request, matching the original report.

    One consideration for a fix: T3 also uses usage limits for automatic model-selection decisions, so reporting an account's limits and assuming all traffic through an arbitrary custom endpoint consumes those limits may need separate treatment. This bridge can route different kinds of requests, so the local URL alone may not establish which quota applies to every model.

    Investigation performed with Codex; no credentials or account identifiers are included.

  3. KevinXC5 commented on Nov 13, 2026

    @KevinXC5
    KevinXC5
    on Nov 13, 2026
    More actions

    Confirmed on a newer macOS Nightly as well.

    Environment:

    • macOS, T3 Code desktop 0.1.10-nightly.20261113.4616
    • codex-cli 0.168.0
    • Default Codex provider enabled, authenticated with ChatGPT Plus (not an API key)
    • Codex routed through a local magpie gateway:
    openai_base_url = "http://127.0.0.1:3425/backend-api/codex"

    Usage → Limits displays No provider on the selected environments reports subscription limits. This setup previously displayed the limits.

    Read-only investigation on the affected machine:

    1. Started codex app-server in the same environment, completed initialize / initialized, and called account/read. It returned account.type = "chatgpt" and requiresOpenaiAuth = true.
    2. account/rateLimits/read succeeded, returning ordinaryUsageAllowed = true, rateLimitsByLimitId.codex.primary.usedPercent = 5, secondary.usedPercent = 10, and planType = "plus". The underlying endpoint still returns valid five-hour and weekly usage windows.
    3. Inspected the installed T3 bundle and confirmed that it contains the routesToNativeOpenai / codexRoutesSpendNativeQuota gate introduced in fix(server): custom Codex providers no longer report native quota #18622. The loopback URL above fails that check, causing T3 to skip the limits request.
    4. No account/rateLimits/read requests were found in the locally retained T3 server trace logs, consistent with that code path.

    This matches the original report: T3 skips the quota query because of the local forwarding URL; the account has remaining allowance and the Codex quota endpoint works. An explicit way to declare a local gateway as forwarding to OpenAI would help preserve this use case while retaining #18622's protection against misattributing subscription quota to third-party routes.

    Validation was limited to live read-only API calls and inspection of the installed bundle. No configuration was changed, and no comparison with the proxy removed was performed. No credentials or account identifiers are included. Investigation assisted by Codex.

  4. IcyTower1337 commented on Nov 18, 2026

    @IcyTower1337
    IcyTower1337
    on Nov 18, 2026
    More actions

    Another repro, this time on a named custom provider rather than openai_base_url. That matches the confirmed named proxy case in #37646.

    Environment

    • macOS, T3 Code Nightly 0.1.11-nightly.20261118.4877
    • codex-cli 0.170.0, ChatGPT login (team plan), default Codex instance (not managed)
    • Codex is routed through a local Headroom (context-compression) pass-through proxy:
    model_provider = "headroom"
    openai_base_url = "http://127.0.0.1:8787/v1"
    
    [model_providers.headroom]
    name = "Headroom persistent proxy"
    base_url = "http://127.0.0.1:8787/v1"
    supports_websockets = true
    requires_openai_auth = true

    What happens
    Limits showed until the proxy was added. Since then T3 never shows Codex limits.

    Investigation (read-only)

    1. codex app-server → account/rateLimits/read returns valid codex windows (primary 300 min, secondary 10080 min). The result is the same with -c model_provider="openai" and with the proxy.
    2. Rollouts written through the proxy still have full rate_limits on every token_count event, so the proxy passes the quota through.
    3. The installed bundle still has the original codexRoutesSpendNativeQuota gate. codexRouteBaseUrl resolves model_providers.headroom.base_url, so http://127.0.0.1:8787/v1 fails routesToNativeOpenai, nativeUsage is false, and the snapshot is unavailable: unsupported. T3CODE_CODEX_SUBSCRIPTION_QUOTA_BASE_URL isn't in this build yet.

    On #37646
    The opt-in env var covers this setup with T3CODE_CODEX_SUBSCRIPTION_QUOTA_BASE_URL=http://127.0.0.1:8787/v1, because the named provider's base_url is what gets compared. +1 for merging it.

    Update: I tested the PR on this machine with this exact setup. On base the limits stay unsupported. With the exact URL declared, Session and Weekly limits come back, and a changed port or path keeps them hidden. Results: #37646 (comment)

    A possible follow-up: a named provider that sets requires_openai_auth = true could count as an implicit signal, since Codex then sends the ChatGPT login's token to that endpoint. I understand the multi-account hub concern from #18622, though, so the explicit opt-in seems like the safer default.

    No credentials or account identifiers included.

  5. karlyzo commented on Nov 27, 2026

    @karlyzo
    karlyzo
    on Nov 27, 2026
    More actions

    Still reproducible on T3 Code v0.1.13 (stable, desktop on Windows with WSL runtime) with codex-cli 0.172.0 routed through Headroom.

    Setup (~/.codex/config.toml, written by headroom init):

    model_provider = "headroom"
    openai_base_url = "http://127.0.0.1:8787/v1"
    
    [model_providers.headroom]
    name = "OpenAI"
    base_url = "http://127.0.0.1:8787/v1"
    supports_websockets = true
    requires_openai_auth = true

    Account: ChatGPT login, planType: "pro".

    Observed

    • The cached provider snapshot (~/.t3/caches/[codex.json](https://github.com/home/codex/.t3/caches/codex.json)) contains:
      "usageLimits": {"windows": [], "unavailable": {"reason": "unsupported"}}
    • Usage → Limits shows no Codex row. Thread details show "Limits: Unavailable".

    But codex app-server returns the quota normally on the same config:
    account/rateLimits/read →

    "primary": {"usedPercent": 99, "windowDurationMins": 10080, "resetsAt": 1795859640},
    "secondary": null,
    "planType": "pro"

    account/rateLimits/updated notifications arrive during turns with the same payload. So the data reaches T3, and codexRoutesSpendNativeQuota() drops it because routesToNativeOpenai() returns false for 127.0.0.1:8787.

    Impact: the weekly limit reached 99% with no warning in T3. The first sign was the turn failing with "You've hit your usage limit".

    The opt-in declaration in #37646 (T3CODE_CODEX_SUBSCRIPTION_QUOTA_BASE_URL) would solve this for me. +1 for merging it.

    Side note: Pro accounts currently get only a weekly window (primary = 10080 min, secondary: null). The mapping in codexRateLimitsToWindows already labels this "Weekly", so that part looks fine.

  6. scwlkr commented on Nov 28, 2026

    @scwlkr
    scwlkr
    on Nov 28, 2026
    More actions

    Another source of this config: ollama launch codex (Ollama 0.40.18) writes

    model_catalog_json = "~/.codex/ollama-launch-models.json"
    openai_base_url = "http://127.0.0.1:11434/api/codex/v1"

    into ~/.codex/config.toml and leaves it there after you stop using it. With a ChatGPT Pro login, the provider snapshot reports usageLimits.unavailable.reason: "unsupported". Meanwhile account/rateLimits/read on the same codex app-server returns the live weekly window, and the provider event log keeps getting account/rateLimits/updated with usedPercent going up (0 → 28 over two days). So the quota really is being spent and T3 discards it.

    macOS, T3 Code 0.1.14-nightly.20261128.5399, codex-cli 0.172.0.

    A worse side effect is filed separately: with a linked environment offline, Usage → Limits then shows that machine's expired snapshot as the only Codex reading (#45073).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.