Add 429 retry/backoff to Grain client - #2
Draft
dplakon wants to merge 1 commit into
Draft
Conversation
The daily meeting fetch was failing with HTTP 429 (Too Many Requests) because list_all_recordings paginated back-to-back with no delay or retry handling. Add exponential backoff with Retry-After support on 429 responses in _get(), plus a small delay between pagination requests to avoid tripping the rate limit. Co-Authored-By: Oz <oz-agent@warp.dev>
Jerrydiii
approved these changes
Jul 18, 2026
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.
Summary
The Grainiac daily meeting fetch (
scripts/fetch_daily_meetings.py) was failing withHTTP Error 429: Too Many Requestsfrom the Grain API. The failure consistently occurred on the second (cursor-based) page of results becauselist_all_recordingspaginated back-to-back with no delay and the client had no retry handling for rate limits.Changes
Retry-Afterheader support on429responses ingrain_client._get()(up to 5 attempts).list_all_recordingsto avoid tripping the rate limit in the first place.Testing
python scripts/fetch_daily_meetings.py today— previously failed on page 2 with 429; now paginates through all recordings and returns the expected JSON meeting list.Conversation: https://app.warp.dev/conversation/2cbe8b08-da81-4b5a-a805-77589012a120
Run: https://oz.warp.dev/runs/019f71a3-a26d-7604-b3c4-1d020091a747
This PR was generated with Oz.