Skip to content

Conversation

@tombl
Copy link
Contributor

@tombl tombl commented Oct 30, 2025

Fixes #4161

Currently Codex uses a regex to parse the "Please try again in 1.898s" OpenAI-style rate limit message, so that it can wait the correct duration before retrying. Azure OpenAI returns a different error that looks like "Rate limit exceeded. Try again in 35 seconds."

This PR extends the regex and parsing code to match in a more fuzzy manner, handling anything matching the pattern "try again in <duration><unit>".

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@tombl
Copy link
Contributor Author

tombl commented Oct 30, 2025

I have read the CLA Document and I hereby sign the CLA

github-actions bot added a commit that referenced this pull request Oct 30, 2025
@tombl tombl marked this pull request as draft October 30, 2025 09:31
@tombl tombl force-pushed the push-qlmpzxuuqswu branch from 8d2d9c5 to ade1eaa Compare October 30, 2025 09:44
@tombl tombl marked this pull request as ready for review October 30, 2025 12:59
@etraut-openai
Copy link
Collaborator

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai
Copy link
Collaborator

Thanks for the contribution, and apologies for the slow response. We were overwhelmed by PR request, and we're catching up on the backlog.

I think this is a good change, but it would be better if it's a little more surgical. I'm guessing that it's AI-generated. Please take a look at my comments and questions.

@tombl tombl force-pushed the push-qlmpzxuuqswu branch from 24df41c to e28332e Compare November 1, 2025 11:23
@tombl
Copy link
Contributor Author

tombl commented Nov 1, 2025

I've updated the PR to be the bare minimum diff necessary.

It was written with LLM assistance but ultimately the choice to defensively handle other units was mine. I've done some more research and it looks like Azure does always return seconds, so I've reverted that part.

(also your response wasn't slow at all, I'm used to corporate open source projects taking much longer to review community PRs, so thank you!)

@tombl tombl requested a review from etraut-openai November 1, 2025 11:36
@etraut-openai
Copy link
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Another round soon, please!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@etraut-openai etraut-openai merged commit d9118c0 into openai:main Nov 1, 2025
25 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 1, 2025
@etraut-openai
Copy link
Collaborator

Thanks again for the contribution! This will improve the experience for a lot of Azure OpenAI users.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stream retry does not honor “Try again in x seconds” delays; falls back to exponential backoff

2 participants