"Rate limit reached" crashes the codex instance instead of sleeping/waiting
Resolved 💬 3 comments Opened May 25, 2025 by devcadotio Closed Aug 7, 2025
What version of Codex is running?
0.1.2504172351
Which model were you using?
o4-mini
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64 with WSL version: 2.4.13.0
What steps can reproduce the bug?
Have codex do a action on a larger codebase, such as refactoring a huge piece of code or putting files in their respective directory
What is the expected behavior?
Codex should sleep/wait until tokens are available again
What do you see instead?
e [Error]: Rate limit reached for o4-mini in organization [redacted] on tokens per min (TPM): Limit 200000, Used 173363, Requested 27866. Please try again in 368ms. Visit https://platform.openai.com/account/rate-limits to learn more.
Additional information
_No response_
3 Comments
/assign
I am interested in getting a PR for this to handle rate limit error cleanly.
This is really annoying!! At least why not return some handle to the context so if it is not possible to do a next turn include this in a new session.
Thanks for the feedback! Please try again on the latest version of Codex CLI. If the issue persists, we'd appreciate it if you could test with the native/Rust implementation of Codex CLI.