Skip to content

Implement rate-limit handling #11

Closed

Description

@codebestia

Description

When the API returns HTTP 429, the SDK should parse the Retry-After header (seconds) and either automatically wait and retry (if within max_retries) or raise RateLimitError with the wait time attached. The caller should never need to implement their own 429 backoff.

Proposed Steps

  • In the response parser, detect HTTP 429 before raising a generic error.
  • Parse Retry-After header (integer seconds) and attach it to the RateLimitError.
  • If auto-retry is enabled and max_retries is not exhausted, sleep for retry_after seconds then retry.
  • In the async client, use asyncio.sleep instead of time.sleep.

Acceptance Criteria

  • A 429 response raises RateLimitError with a retry_after attribute.
  • When retrying, the client waits at least Retry-After seconds before the next attempt.
  • If Retry-After is absent, the client falls back to exponential backoff.
  • Async client uses non-blocking sleep.

Activity

  1. bukkybyte commented on Jun 20, 2026

    @bukkybyte
    Contributor

    Allow me work on this and dwliver PR within 2 days

  2. grantfox-oss commented on Jun 21, 2026

    @grantfox-oss

    🦊 GrantFox — @bukkybyte has been assigned to this issue as part of the Official Campaign campaign!

    Next steps:

    1. Open a Pull Request referencing this issue (e.g., Closes #11)
    2. Your PR will be reviewed by the ShadeProtocol maintainers

    Good luck! Track your progress on GrantFox.

  3. added 2 commits that reference this issue on Jun 24, 2026
  4. grantfox-oss commented on Jun 24, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox as part of the Official Campaign campaign!

    @bukkybyte's PR #24 was approved and merged by @codebestia.

    🏆 @bukkybyte: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (506 total points). Track your full progress on GrantFox.

    👏 Great work, @bukkybyte! Keep contributing to ShadeProtocol.

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions