Skip to content

[Bug]: OpenClaw Gateway incorrectly reports false "Codex subscription usage limit" while Codex CLI works with the same ChatGPT OAuth account #96815

Description

@xxw77

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

OpenClaw Gateway incorrectly reports "You've reached your Codex subscription usage limit" while Codex CLI works successfully with the same ChatGPT OAuth account, CODEX_HOME, and GPT-5.5 model.

Steps to reproduce

  1. Install OpenClaw 2026.6.10 and @openclaw/codex 2026.6.10.

  2. Login using ChatGPT OAuth:

    CODEX_HOME="$HOME/.openclaw/agents/main/agent/codex-home" codex auth login

  3. Verify auth.json contains:
    "auth_mode": "chatgpt"

  4. Verify Codex CLI works:

    CODEX_HOME="$HOME/.openclaw/agents/main/agent/codex-home"
    codex exec --skip-git-repo-check "what is 1+1"

    Result: returns "2"

  5. Start OpenClaw Gateway.

  6. Send any message (for example "你好") from the Feishu channel.

  7. Gateway immediately returns:
    "You've reached your Codex subscription usage limit."

Expected behavior

After successful ChatGPT OAuth login, OpenClaw Gateway should process the request using the configured model (openai/gpt-5.5), matching the observed behavior of Codex CLI with the same OAuth account and CODEX_HOME.

Actual behavior

Codex CLI succeeds with the same ChatGPT OAuth account, CODEX_HOME and model (openai/gpt-5.5).

However, when the request is sent through OpenClaw Gateway (Feishu channel), Gateway immediately returns:

"You've reached your Codex subscription usage limit. OpenClaw could not determine a reset time from Codex."

Gateway logs include:

provider=openai
model=openai/gpt-5.5
reason=rate_limit

No model response is generated.

OpenClaw version

2026.6.10 (aa69b12)

Operating system

macOS 15.5

Install method

npm global

Model

openai/gpt-5.5

Provider / routing chain

OpenAI (ChatGPT OAuth) -> @openclaw/codex -> Codex CLI 0.142.0

Additional provider/model setup details

Provider: OpenAI
Model: openai/gpt-5.5
Authentication: ChatGPT OAuth (auth_mode=chatgpt)

The same ChatGPT OAuth account and the same CODEX_HOME are used by both:

  • Codex CLI 0.142.0
  • OpenClaw Gateway (@openclaw/codex 2026.6.10)

Codex CLI succeeds, while OpenClaw Gateway consistently reports:

"You've reached your Codex subscription usage limit."

Logs, screenshots, and evidence

Attached evidence:

1. codex exec succeeds using the same ChatGPT OAuth account and the same CODEX_HOME:

CODEX_HOME="$HOME/.openclaw/agents/main/agent/codex-home" \
codex exec --skip-git-repo-check "what is 1+1"

Output:
2

2. OpenClaw Gateway using the same model (openai/gpt-5.5) and the same authentication fails immediately.

Gateway log:

You've reached your Codex subscription usage limit.
OpenClaw could not determine a reset time from Codex.

reason=rate_limit
provider=openai
model=gpt-5.5

3. auth.json is in ChatGPT OAuth mode (auth_mode=chatgpt), not API key mode.

Impact and severity

Affected:
OpenClaw Gateway using the OpenAI Codex provider.

Severity:
Blocks the workflow because the gateway cannot generate any response.

Frequency:
Always reproducible.

Consequence:
Direct Codex CLI works, but all

Additional information

The issue is reproducible.

Using the same ChatGPT OAuth account, the same CODEX_HOME and the same model (openai/gpt-5.5):

  • Codex CLI succeeds.
  • OpenClaw Gateway always reports:
    "You've reached your Codex subscription usage limit."

This indicates that the failure happens inside the OpenClaw Codex integration rather than the account [itself.](url)

Image

Activity

  1. clawsweeper commented on Jun 25, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 17, 2026, 11:28 PM ET / July 18, 2026, 03:28 UTC.

    Summary
    Keep open for maintainer follow-up: the linked merged PR explicitly targets the reported false usage-limit classifier, but the issue was reopened and assigned by steipete on July 18, 2026 after that merge. That current maintainer signal means the remaining question should not be auto-closed without confirming the observed Gateway-versus-CLI path and release status.

    Reproducibility: no. the issue has detailed older-version steps, but this review could not run a current-main or released-build reproduction, and the issue was reopened after the linked fix merged.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Next step
    A maintainer must interpret the explicit post-merge reopen and confirm the current Gateway/app-server behavior before this can safely close.

    Maintainer decision needed

    • Question: Does the July 18, 2026 reopen mean the merged structural classifier fix failed to resolve this reporter’s Gateway/app-server path, or is a current-version verification still pending?
    • Rationale: The linked PR claims to fix the central classifier defect, but the same person who merged it reopened and assigned the issue afterward; source and live-path inspection could not be completed in this sandbox.
    • Likely owner: steipete — They merged the linked fix and then reopened and assigned this report, making them the clearest available owner for the remaining triage decision.
    • Options:
      • Run targeted current-version repro (recommended): Reproduce the same OAuth/CODEX_HOME Gateway path on a build containing the merge and close only when its error metadata no longer produces the false subscription-limit message.
      • Split a remaining defect: If the structured classifier is correct but Gateway still differs from codex exec, open or link a narrower issue for the remaining app-server/auth-home mismatch and retain this report as its evidence.
    Review details

    Best possible solution:

    Reproduce the Gateway app-server path with the reporter’s ChatGPT OAuth setup on a build containing the linked fix, compare its structured Codex error metadata with codex exec, and close only if the false classification no longer occurs or a narrower remaining bug is identified.

    Do we have a high-confidence way to reproduce the issue?

    No; the issue has detailed older-version steps, but this review could not run a current-main or released-build reproduction, and the issue was reopened after the linked fix merged.

    Is this the best way to solve the issue?

    Unclear; the merged structured-classification change is the right narrow fix for generic text matching, but the reopened status means it is not yet proven to resolve the reporter’s complete Gateway-versus-CLI scenario.

    AGENTS.md: unclear because the file could not be read completely.

    Remaining risk / open question:

    • Closing now could hide a remaining same-account Gateway/app-server mismatch that the merged structural classifier fix did not cover; the post-merge reopen indicates that question remains active.
    • Release inclusion is unverified: the current review could not determine whether v2026.7.1 contains merge commit 1a27e7f3ec2febf4fc36c7b5bd2a984630e05449.

    Codex review notes: model internal, reasoning high; reviewed against 1aa0d73823a0.

    Label changes

    Label changes:

    • add issue-rating: 🦪 silver shellfish: Current issue advisory state selects this label.
    • remove clawsweeper:needs-product-decision: Current issue advisory state no longer selects this label.
    • remove clawsweeper:needs-live-repro: Current issue advisory state no longer selects this label.
    • remove issue-rating: 🐚 platinum hermit: Current issue advisory state no longer selects this label.

    Label justifications:

    • P1: The reported Gateway route consistently returns an error instead of processing messages through a supported OAuth-backed model.
    • impact:auth-provider: The report concerns ChatGPT OAuth credentials, Codex app-server handling, and OpenAI provider routing.
    • impact:message-loss: An incoming Feishu message receives an error rather than the requested model response.
    Evidence reviewed

    What I checked:

    • Linked fix claims this case: Merged PR fix(codex): model-scoped usage-limit blocks, structural 429 classification, no silent API-key billing #108254 explicitly identifies this report as a false-positive caused by isCodexUsageLimitError matching generic “usage limit” text, and says it changes detection to require structured codexErrorInfo === "usageLimitExceeded". (1a27e7f3ec2f)
    • Maintainer reopened after merge: The provided timeline shows the PR merged on July 15, 2026, then steipete closed the issue, referenced the merge commit, and reopened and assigned it on July 18, 2026. That is an explicit current maintainer signal that the merge alone is not a safe terminal resolution. (1a27e7f3ec2f)
    • Current source and release verification unavailable: The read-only inspection command could not run because the managed sandbox rejected loopback setup (bwrap: loopback: Failed RTM_NEWADDR: Operation not permitted), so this review cannot establish current-main source behavior, exact fix-file provenance, or whether v2026.7.1 contains the merge.

    Likely related people:

    • steipete: Authored and merged the linked Codex usage-limit fix, then reopened and assigned this report after the merge. (role: linked-fix author and recent follow-up owner; confidence: high; commits: 1a27e7f3ec2f)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P1High-priority user-facing bug, regression, or broken workflow.
    impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.
    impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.
    clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    on Jun 25, 2026
  3. xxw77 commented on Jun 26, 2026

    @xxw77
    Author

    Additional information after further testing:

    I confirmed that this is not caused by API key authentication.

    Current authentication is:

    auth_mode=chatgpt

    The following command succeeds:

    CODEX_HOME="$HOME/.openclaw/agents/main/agent/codex-home"
    codex exec --skip-git-repo-check "what is 1+1"

    Output:

    2

    However, using the same ChatGPT OAuth account, the same CODEX_HOME and the same model (openai/gpt-5.5), OpenClaw Gateway always returns:

    "You've reached your Codex subscription usage limit."

    This seems to be specific to the Gateway / Codex integration rather than the account itself.

  4. openclaw-barnacle commented on Jul 10, 2026

    @openclaw-barnacle

    This issue has been automatically marked as stale due to inactivity.
    Please add updates or it will be closed.

  5. self-assigned this
    on Jul 18, 2026
  6. added
    issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.
    and removed
    clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.
    clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.
    issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.
    on Jul 18, 2026
  7. locked as resolved and limited conversation to collaborators on Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingbug:behaviorIncorrect behavior without a crashclawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.issue-rating: 🦪 silver shellfishThin issue quality; more reproduction proof or environment detail is needed.staleMarked as stale due to inactivity

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions