Monthly usage limit drains abnormally fast (25% → 5% within ~15 tool calls in one session)

Open
#33,634 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
rust
Domain
cli

Research direction

The report names no repository files, tests, or entry points. Start by reproducing the usage change with Codex CLI 0.144.5, gpt-5.5, and a Plus account while recording tool calls and remaining quota; done means identifying whether the client reports or triggers incorrect accounting and adding a regression test if a repository-side cause is found.

Written by the indexing model from the issue text.

Description

bug CLI rate-limits session
What version of Codex CLI is running?

codex-cli 0.144.5

What subscription do you have?

Plus

Which model were you using?

gpt-5.5 (medium reasoning)

What platform is your computer?

Darwin 24.6.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

ZED

Codex doctor report
{
  "schemaVersion": 1,
  "generatedAt": "1784218627s since unix epoch",
  "overallStatus": "warning",
  "codexVersion": "0.144.5",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/Users/szymonnowicki/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/Users/szymonnowicki/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/Users/szymonnowicki/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/Users/szymonnowicki/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/Users/szymonnowicki/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth env vars present": "OPENAI_API_KEY",
        "auth file": "/Users/szymonnowicki/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/Users/szymonnowicki/.codex",
        "config.toml": "/Users/szymonnowicki/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/Users/szymonnowicki/Local Sites/sklepledy/app/public/wp-content/themes/alufrost-shop",
        "enabled feature flags": "shell_tool, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, skill_mcp_dependency_install, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "35",
        "log dir": "/Users/szymonnowicki/.codex/log",
        "mcp servers": "1",
        "model": "gpt-5.5",
        "model provider": "openai",
        "sqlite home": "/Users/szymonnowicki/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.52.0",
      "details": {
        ".git entry": "directory",
        "PATH git #1": "/opt/homebrew/bin/git",
        "PATH git #2": "/usr/bin/git",
        "PATH git entries": "2",
        "git branch": "master",
        "git build options": "git version 2.52.0; cpu: arm64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; rust: disabled; feature: fsmonitor--daemon; libcurl: 8.7.1; zlib: 1.2.12; SHA-1: SHA1_DC; SHA-256: SHA256_BLK; default-ref-format: files; default-hash: sha1",
        "git exec path": "/opt/homebrew/opt/git/libexec/git-core",
        "git version": "git version 2.52.0",
        "repo detected": "true",
        "repo root": "/Users/szymonnowicki/Local Sites/sklepledy/app/public/wp-content/themes/alufrost-shop",
        "selected git": "/opt/homebrew/bin/git"
      },
      "remediation": null,
      "durationMs": 165
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/opt/homebrew/bin/codex",
        "current executable": "/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin/codex",
        "install context": "npm (package /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin, bin /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin, resources /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-resources, path /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path)",
        "managed by bun": "false",
        "managed by npm": "true",
        "managed by pnpm": "false",
        "managed package root": "/opt/homebrew/lib/node_modules/@openai/codex",
        "npm update target": "/opt/homebrew/lib/node_modules/@openai/codex"
      },
      "remediation": null,
      "durationMs": 167
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "warning",
      "summary": "MCP configuration has optional issues",
      "details": {
        "configured servers": "1",
        "disabled servers": "0",
        "pencil": "stdio command \"/Applications/Pencil.app/Contents/Resources/app.asar.unpacked/out/mcp-server-darwin-arm64\" is not resolvable (No such file or directory (os error 2))",
        "stdio servers": "1"
      },
      "remediation": "Set the missing MCP env vars or disable the affected server.",
      "durationMs": 0
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "openai API base URL": "https://api.openai.com/v1 reachable (HTTP 404)",
        "openai API route probe": "https://api.openai.com/v1/<redacted> route exists (HTTP 401)",
        "reachability mode": "API key auth"
      },
      "remediation": null,
      "durationMs": 914
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 0 IPv6, first IPv4",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "true",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 857
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running npm on macos-aarch64",
      "details": {
        "commit": "unknown",
        "current executable": "/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin/codex",
        "install method": "npm (package /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin, bin /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/bin, resources /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-resources, path /opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path)",
        "platform": "macos-aarch64",
        "version": "0.144.5"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/opt/homebrew/lib/node_modules/@openai/codex/node_modules/@openai/codex-darwin-arm64/vendor/aarch64-apple-darwin/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "OnRequest",
        "codex-linux-sandbox helper": "none",
        "execve wrapper helper": "/Users/szymonnowicki/.codex/tmp/arg0/codex-arg0c5E1fb/codex-execve-wrapper",
        "filesystem sandbox": "restricted",
        "network sandbox": "restricted"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/Users/szymonnowicki/.codex (dir)",
        "active rollout files": "2402 files, 153024721 total bytes, 63707 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/Users/szymonnowicki/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/Users/szymonnowicki/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/Users/szymonnowicki/.codex/log (dir)",
        "memories DB": "/Users/szymonnowicki/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "/Users/szymonnowicki/.codex (dir)",
        "state DB": "/Users/szymonnowicki/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 2853
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "ok",
      "summary": "rollout files and state DB thread inventory agree",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "2402",
        "rollout DB active rows": "2402",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "0",
        "rollout DB archived rows": "0",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "0",
        "rollout DB missing active rows": "0",
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "openai=2402",
        "rollout DB rows": "2402",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "exec=2265, cli=136, vscode=1",
        "rollout DB stale rows": "0"
      },
      "remediation": null,
      "durationMs": 3103
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language pl-PL",
      "details": {
        "EDITOR": "not set",
        "LANG": "en_US.UTF-8",
        "VISUAL": "not set",
        "os": "Mac OS 15.6.1 [64-bit]",
        "os language": "pl-PL",
        "os type": "Mac OS",
        "os version": "15.6.1"
      },
      "remediation": null,
      "durationMs": 6
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "COLORTERM": "truecolor",
        "TERM_PROGRAM": "zed",
        "color output": "enabled",
        "effective locale": "en_US.UTF-8",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "90x29",
        "terminal version": "1.10.3+stable.324.0c54c414d522234de7298039708ffe85a116892a"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "git repo root",
        "terminal title project value": "alufrost-shop",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.144.5",
        "check for update on startup": "true",
        "dismissed version": "0.140.0",
        "last checked at": "2026-07-16T05:39:16.971881Z",
        "latest version": "0.144.5",
        "latest version status": "current version is not older",
        "npm update target": "/opt/homebrew/lib/node_modules/@openai/codex",
        "update action": "npm install -g @openai/codex",
        "version cache": "/Users/szymonnowicki/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 672
    }
  }
}
What issue are you seeing?

Monthly token usage limit drained from 25% remaining to 5% remaining within a single working session, across roughly 15 tool calls (mostly Read/Search on existing files, no large file writes). No corresponding heavy task was run — the calls were standard file reads (Read on ProductController.php, archive-product.blade.php, ArchiveProductController.php, single-product.blade.php, SettingsShop.php, ajax.php, vite.config.js, etc.) in a WordPress/Bedrock/Sage theme repo.

Notably, this session was a resumed session after an earlier prompt was interrupted mid-run:

■ Conversation interrupted - tell the model what to do differently.

I re-sent the same prompt immediately after the interruption. It's possible the interrupted session's context/cache was not properly cleared and got double-counted when the same prompt was re-run, causing inflated token accounting.

For reference, the prior task in the same CLI session reported:

Token usage: total=188 124 input=172 050 (+ 3 523 328 cached) output=16 074 (reasoning 3074)

This is a very large cached-token count relative to the actual output, which raises the question of whether cached context is being over-counted against the monthly limit, especially across resumed/interrupted sessions.

I have never used more than ~50% of a single 5-hour window in normal use, so a monthly limit dropping this fast in one session is inconsistent with my typical usage pattern.

What steps can reproduce the bug?
  1. Start a Codex CLI session, run a task to completion (e.g. editing CSS/blade files), note token usage report.
  2. Start a new prompt in the same session.
  3. Interrupt the conversation mid-run (Conversation interrupted).
  4. Re-send the same prompt again without starting a fresh session.
  5. Continue running standard Read/Search tool calls (reading existing repo files, no large edits).
  6. Observe monthly usage limit banner dropping rapidly (25% → 10% → 5%) within a small number of read-only tool calls.

Thread/session id: 019f6b9c-a881-7ea1-add9-1da57a2c5d5e

What is the expected behavior?

Monthly usage limit should decrease proportionally to actual token consumption (input + output), and cached/resumed session context should not be double-counted after an interruption. Read-only exploration of a handful of moderately-sized files should not consume ~20% of a monthly quota in a single session.

Additional information

This matches patterns reported in other issues around the same period (e.g. #30918 — "Usage limits draining abnormally fast on Plus: 70% to 100% in about 6 minutes on July 2, 2026"), where OpenAI acknowledged a usage-accounting bug and shipped a fix on June 30, 2026, but users continued to report abnormal drains afterward. Happy to provide sanitized session logs if useful (redacting prompts/file contents).

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.