codex icon indicating copy to clipboard operation
codex copied to clipboard

Rate Limits should not disconnect a session.

Open ReyNeill opened this issue 1 year ago • 14 comments

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

ReyNeill avatar Apr 20 '25 21:04 ReyNeill

Yes, it is very annoying.

agung483 avatar Apr 21 '25 01:04 agung483

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?

ayesimple93 avatar Apr 21 '25 01:04 ayesimple93

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.

RichardCrawford-Repo avatar Apr 21 '25 01:04 RichardCrawford-Repo

Running into the same issue. Stoked for a fix for this! Version: 0.1.2504172351

Aylr avatar Apr 21 '25 02:04 Aylr

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.

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...).

WASasquatch avatar Apr 21 '25 03:04 WASasquatch

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.

macovedj avatar Apr 21 '25 14:04 macovedj

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?

WASasquatch avatar Apr 21 '25 14:04 WASasquatch

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.

Ironically, this worked for me too. And I am still tier 1.

Image

kevin-m-dean avatar Apr 21 '25 16:04 kevin-m-dean

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.

WASasquatch avatar Apr 21 '25 16:04 WASasquatch

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

danielj86 avatar Apr 21 '25 20:04 danielj86

Lots of bugs open for this one issue?!? https://github.com/openai/codex/issues?q=is%3Aissue%20state%3Aopen%20rate%20limit

wbraswell avatar Apr 22 '25 01:04 wbraswell

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.

yuki2006 avatar Apr 22 '25 02:04 yuki2006

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.

WASasquatch avatar Apr 22 '25 03:04 WASasquatch

Should be fixed in latest release, please install 0.1.2504221401 and re-open if this is still an issue you encounter.

tibo-openai avatar Apr 22 '25 22:04 tibo-openai