Repository navigation
feat(events): expose x-ratelimit-events-* headers and honor 429 Retry-After - #6
Merged
Merged
Conversation
…StatusError Add frozen EventsRateLimit(limit, remaining, reset, window) in types/events.py and export it from whitecircle.types. Populate rate_limit on EventCheckResult and EventsCheckResult in sync and async events.check/check_many via an internal _send_request/_post_with_headers hook (leaving public request() unchanged), and expose APIStatusError.rate_limit from error.response.headers.
Parse numeric Retry-After seconds on HTTP 429 responses and clamp the retry delay to [MIN_RATE_LIMIT_RETRY_DELAY, MAX_RETRY_DELAY], falling back to exponential backoff when Retry-After is absent or non-numeric. Update README, docs/errors-and-testing.md, and AGENTS.md.
Add a Rate limits section to docs/errors-and-testing.md covering what counts toward the per-second Event limit, where rejections appear (200 failed vs 429 on skip batches), reading result.rate_limit and error.rate_limit, and resending failed Events after rate_limit.reset. Add Unreleased Added entries to CHANGELOG.md.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
…ementation Move _send_request above @overload def request on SyncAPIClient and AsyncAPIClient so each overload group immediately precedes its implementation as required by PEP 484 and mypy.
…nd reject window <= 0
…9 retry Verify Retry-After is ignored on HTTP 503, monthly-quota 429 with Retry-After is still not retried, and events.check_many(..., skip=True) retries a 429 with Retry-After and attaches rate_limit from the subsequent 200 response.
Base automatically changed from
fix/review-findings
to
feature/policy-targeting
December 2, 2026 16:00
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Stacked on
fix/review-findings(#5). Exposes the per-second Event rate-limit headers fromwhitecircle/core-platform#982and honors numericRetry-Afteron HTTP 429 retries.Commits
10d5ee4—feat(events): add frozenEventsRateLimit(limit, remaining, reset, window), populateEventCheckResult.rate_limitandEventsCheckResult.rate_limitfromx-ratelimit-events-*headers on sync/asyncevents.check()andevents.check_many()(via internal_send_request/_post_with_headers, leaving publicrequest()unchanged), and addAPIStatusError.rate_limit.075c6ec—feat(client): honor numericRetry-Afterseconds on HTTP 429 responses, clamped to[MIN_RATE_LIMIT_RETRY_DELAY, MAX_RETRY_DELAY], falling back to exponential backoff when absent or non-numeric; updateREADME.md,docs/errors-and-testing.md, andAGENTS.md.669e32b—docs: add a Rate limits section todocs/errors-and-testing.md(what counts, 200 failed vs 429 skip-batch rejections,result.rate_limit, and a resend snippet) andCHANGELOG.mdAddedentries.