Codex crashes when hitting rate limit rather than waiting

Resolved 💬 4 comments Opened Apr 16, 2025 by adamkdean Closed Apr 16, 2025
💡 Likely answer: A maintainer (tibo-openai, collaborator) responded on this thread — see the highlighted reply below.

Codex crashes when hitting rate limit rather than waiting.

Given that it needed to wait 3.6 seconds, it should really just hang back and wait.

(It also listed all files which is fine, but included node_modules which made up a large chunk of those tokens.)

[Error]: Rate limit reached for o4-mini in organization org-<snip> on tokens per min (TPM): Limit 200000, Used 166273, Requested 46014. Please try again in 3.686s. Visit https://platform.openai.com/account/rate-limits to learn more.
    at e.a [as iterator] (file:///Users/adam/.nvm/versions/node/v22.13.1/lib/node_modules/@openai/codex/dist/cli.js:443:1514)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async I0.run (file:///Users/adam/.nvm/versions/node/v22.13.1/lib/node_modules/@openai/codex/dist/cli.js:460:2513) {
  status: undefined,
  headers: undefined,
  request_id: undefined,
  error: {
    type: 'tokens',
    code: 'rate_limit_exceeded',
    message: 'Rate limit reached for o4-mini in organization org-<snip> on tokens per min (TPM): Limit 200000, Used 166273, Requested 46014. Please try again in 3.686s. Visit https://platform.openai.com/account/rate-limits to learn more.',
    param: null
  },
  code: 'rate_limit_exceeded',
  param: null,
  type: 'tokens'
}

View original on GitHub ↗

4 Comments

tibo-openai collaborator · 1 year ago

Dupe of https://github.com/openai/codex/issues/88, we're working on this.

danielj86 · 1 year ago

The real issue here should be to handle node_modules dir correctly (ignoring it in most of the cases)

tibo-openai collaborator · 1 year ago

Could you open a separate issue for this and we can discuss there? Closing this one in favor of https://github.com/openai/codex/issues/88

adamkdean · 1 year ago
Dupe of #88, we're working on this.

Missed that, apologies Tibo!

Codex is 🚀 so far!