Rate Limits should not disconnect a session.
What version of Codex is running?
v0.1.2504172351
Which model were you using?
o4-mini
What platform is your computer?
macOS
What steps can reproduce the bug?
Hit rate limit rate with a long request, e.g: "Refactor my codebase following X steps"
What is the expected behavior?
When rate limits are exceeded, the codex session should not be lost (codex quits itself), since the model loses all the context earned throughout the session!
What do you see instead?
e [Error]: Rate limit reached for o4-mini in organization REDACTED on tokens per min (TPM): Limit 200000, Used 160193, Requested 51963. Please try again in 3.646s. Visit https://platform.openai.com/account/rate-limits to learn more.
at e.a [as iterator] (REDACTED)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async T0.run (REDACTED) {
status: undefined,
headers: undefined,
request_id: undefined,
error: {
type: 'tokens',
code: 'rate_limit_exceeded',
message: 'Rate limit reached for o4-mini in organization REDACTED on tokens per min (TPM): Limit 200000, Used 160193, Requested 51963. Please try again in 3.646s. Visit https://platform.openai.com/account/rate-limits to learn more.',
param: null
},
code: 'rate_limit_exceeded',
param: null,
type: 'tokens'
}
Node.js v22.14.0
reyneill@M4-Brain-Interface klip %
Additional information
_No response_
14 Comments
Yes, it is very annoying.
You’d think the half-wits at OpenAI would have thought have something this simple before releasing it to the public. Are they not surprised they are losing customers to other AI companies?
This behaviour makes codex cli not useable for anything remotely complex. I'm building a fairly small web site and codex crashes with rate limits exceeded error on just about every request now. I'm torn between using codex to fix codex or just using a different coding assistant.
Running into the same issue. Stoked for a fix for this! Version: 0.1.2504172351
Over 10 bucks for me just today. And when I tried other models, I just get model errors, or the model itself can't properly use codex tools. At least with an IDE like windsurf I am refunded (ironically using the same models...).
For what it's worth, I told codex not to hit rate limits. It told me it didn't have access to the info to pause so as to avoid rate limits, but functionally I haven't been rate limited since.
Are you sure you didn't just roll over into a higher tier?
Ironically, this worked for me too. And I am still tier 1.
<img width="989" alt="Image" src="https://github.com/user-attachments/assets/3275720e-92b9-45ee-b2db-e99e897958ac" />
There has been a lot of updates overnight, maybe it's fixed. Giving it a try anyway and telling it. Lol We'll see...
Update: It seems to be working, but not positive if that's also just almost 24/hr of not using it.
Update 2: Yeah, no, my tokens were just refreshed. Rate limit is still an issue.
This was reported here 5 days ago, and still no fix.
At this point, Codex is completely unusable, definitely not the standard you'd expect from OpenAI.
https://github.com/openai/codex/issues/88
Lots of bugs open for this one issue?!?
https://github.com/openai/codex/issues?q=is%3Aissue%20state%3Aopen%20rate%20limit
I don’t mind terminating the command, but I’d like the session to be recoverable. The same goes for other situations: for example, if I’m running something and mistype a prompt and want to cancel it, there’s no way to do so. I have to kill it with Ctrl +C, but since the session doesn’t resume afterward, I’m left with no choice but to put up with it. It feels like the same kind of problem.
Yes. This is one thing I like about the IDE's. If it has trouble running commands, or server issues (where you're refunded!), you can simple say "You encountered cascade errors, and tool call errors, perhaps try a different approach?" and it picks up where it left off. Currently the context is just lost with Codex, which sucks.
Should be fixed in latest release, please install 0.1.2504221401 and re-open if this is still an issue you encounter.