Skip to content

Add rate limit handling and RateLimitInfo#15

Merged
vdavez merged 2 commits intomainfrom
feat/rate-limit-handling
Mar 21, 2026
Merged

Add rate limit handling and RateLimitInfo#15
vdavez merged 2 commits intomainfrom
feat/rate-limit-handling

Conversation

@vdavez
Copy link
Contributor

@vdavez vdavez commented Mar 21, 2026

Summary

  • TangoRateLimitError now exposes wait_in_seconds, detail, and limit_type properties parsed from the API's 429 response body
  • TangoClient parses X-RateLimit-* headers on every response and exposes them via client.rate_limit_info (RateLimitInfo dataclass)
  • _request now passes the 429 response body to TangoRateLimitError (previously discarded)

Test plan

  • Existing 429 test updated to verify wait_in_seconds, detail, and limit_type
  • New test for daily limit type detection
  • New test for 429 with empty body (graceful degradation)
  • New test for rate limit header parsing from successful responses
  • All existing tests pass

🤖 Generated with Claude Code

vdavez and others added 2 commits March 21, 2026 05:12
…t headers

TangoRateLimitError now exposes wait_in_seconds, detail, and limit_type
properties from the API's 429 response. TangoClient parses X-RateLimit-*
headers on every response and exposes them via the rate_limit_info property.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vdavez vdavez merged commit edd4158 into main Mar 21, 2026
10 checks passed
@vdavez vdavez deleted the feat/rate-limit-handling branch March 21, 2026 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant