Send limits when getting rate limited#4102
Merged
aibrahim-oai merged 9 commits intomainfrom Sep 23, 2025
Merged
Conversation
pakrym-oai
reviewed
Sep 23, 2025
| } | ||
|
|
||
| if status == StatusCode::TOO_MANY_REQUESTS { | ||
| let rate_limit_snapshot = parse_rate_limit_snapshot(res.headers()); |
Collaborator
There was a problem hiding this comment.
should we put this and event firing above the check for errors?
Collaborator
Author
There was a problem hiding this comment.
but we send it in the error body. We don't have a channel in case of error to fire it.
pakrym-oai
reviewed
Sep 23, 2025
| secondary_used_percent: f64, | ||
| primary_used_percent: f64, | ||
| ) -> Vec<String> { | ||
| if secondary_used_percent == 100.0 || primary_used_percent == 100.0 { |
Collaborator
There was a problem hiding this comment.
no warnings for completely used limits?
Collaborator
Author
pakrym-oai
reviewed
Sep 23, 2025
| let codex_fixture = builder | ||
| .build(&server) | ||
| .await | ||
| .expect("build codex conversation"); |
pakrym-oai
reviewed
Sep 23, 2025
| } | ||
|
|
||
| async fn send_token_count_event(&self, sub_id: &str) { | ||
| let token_event = self.get_token_count_event().await; |
Collaborator
There was a problem hiding this comment.
can we merge in the get_token_count_event ?
pakrym-oai
approved these changes
Sep 23, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Users need visibility on rate limits when they are rate limited.