Skip to content

Bug: ignoring rate limits in api response #2131

@leepjwallace

Description

@leepjwallace

What version of Codex is running?

codex-cli 0.20.0

Which model were you using?

gpt-5

What platform is your computer?

Darwin 24.1.0 arm64 arm

What steps can reproduce the bug?

When executing a task using gpt-5, codex sometimes fails with the above message. This seems to completely break the codex session where exiting out and starting again is the only solution.

The organisation at the time of codex session was Tier 1 (30,000 TPM).

Replaced my OpenAI organisation with placeholder <ORG> in the below error message;

🖐 stream disconnected before completion: Rate limit reached for gpt-5 in organization <ORG> on tokens per min (TPM): Limit 30000, Used 6899, Requested 24050. Please try again in 1.898s. Visit https://platform.openai.com/account/rate-limits to learn more.

What is the expected behavior?

Expected behaviour is codex respects the rate limit headers in the api response to prevent this in codex session.

What do you see instead?

🖐 stream disconnected before completion: Rate limit reached for gpt-5 in organization <ORG> on tokens per min (TPM): Limit 30000, Used 6899, Requested 24050. Please try again in 1.898s. Visit https://platform.openai.com/account/rate-limits to learn more.

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions