fix: handle rate limits (429) and processing-completed state in task polling #587
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
Fixes task polling failures when hitting API rate limits during
--waitoperations.Problem
When waiting for async tasks (like cost report generation), the CLI polls the
/tasks/{id}endpoint. With aggressive polling, users can hit the API rate limit (429), causing the operation to fail even though the task completed successfully:Additionally, the cost report API returns
processing-completedas a terminal state, which was not recognized.Changes
redis-cloudcrateRateLimitederror variant for 429 responses (was falling through to genericApiError)is_retryable()method toCloudError- returns true for 429, 503, and connection errorsredisctlcrateprocessing-completedas a terminal state (alongsidecompleted,succeeded, etc.)is_retryable()errorsTesting
is_retryable()methodprocessing-completedterminal state recognitionRelated
Partially addresses #585 (cost report CLI improvements)