Repository navigation
Add Reset in for rate limits - #4111
Conversation
5637002 to
69ebfcf
Compare
|
@codex review this |
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
codex/codex-rs/core/tests/suite/client.rs
Lines 809 to 820 in 69ebfcf
[P1] Update rate-limit event JSON expectation for new schema
The protocol changed RateLimitSnapshot to expose primary/secondary windows, but the first assertion in token_count_includes_rate_limits_snapshot still expects the old flat fields (primary_used_percent, primary_window_minutes, etc.). With the new struct, serde_json::to_value produces nested objects, so this assertion will now fail and the test suite will be red until it is updated to check the new shape.
codex/codex-rs/core/tests/suite/client.rs
Lines 925 to 930 in 69ebfcf
[P1] Adjust usage-limit error test fixture to nested rate-limit schema
The mock expected_limits JSON still uses the removed top-level keys such as primary_used_percent and primary_to_secondary_ratio_percent. After the protocol change these keys are no longer emitted; rate limits are now nested under primary/secondary windows with used_percent, window_minutes, and resets_in_seconds. Leaving the fixture unchanged will cause the usage-limit test to compare against a shape the code no longer produces.
Reply with @codex fix comments to fix any unresolved comments.
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, or 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 fix this CI failure" or "@codex address that feedback".
|
@codex review this |
|
Codex Review: Didn't find any major issues. Chef's kiss. About Codex in GitHubYour 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, or 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 fix this CI failure" or "@codex address that feedback". |
| primary_window_minutes, | ||
| secondary_window_minutes, | ||
| }) | ||
| let primary_used_percent = parse_header_f64(headers, "x-codex-primary-used-percent"); |
There was a problem hiding this comment.
nit: you can make a function that takes 3 header names and parses a window
Uh oh!
There was an error while loading. Please reload this page.