feat: Auto-retry on retryable provider errors#31
Merged
Conversation
Introduced a new retry mechanism to handle transient API errors gracefully. This includes a `retry` package with configurable options for maximum attempts and delay between retries. The application's options and configuration have been updated to support this new feature, allowing users to specify retry attempts via CLI flags or configuration files. - Implemented `retry.Do` function for generic retry logic. - Added `MaxRetries` option to `cli.options` and `config.Config`. - Enabled configuration of retry attempts via CLI flag `--retry-attempts` and environment variable `RETRY_ATTEMPTS`. - Added unit tests for the new retry functionality.
Introduced a retry mechanism for AI API calls to handle transient errors gracefully. This includes new configuration options for retry attempts and delay, as well as modifications to AI provider error handling to identify retryable errors. - Added `retry-attempts` and `retry-delay` flags and configuration options. - Modified AI provider error handling to wrap retryable errors in a new `retryableError` type. - Implemented a `retry.Do` function to manage the retry logic in the main application run loop. - Updated Anthropic, Gemini, OpenAI, and OpenRouter error handling to correctly identify and flag retryable API responses.
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.
Fixes #27