Skip to content

feat: Auto-retry on retryable provider errors#31

Merged
tarampampam merged 2 commits into
masterfrom
feat/auto-retry
Apr 14, 2026
Merged

feat: Auto-retry on retryable provider errors#31
tarampampam merged 2 commits into
masterfrom
feat/auto-retry

Conversation

@tarampampam

Copy link
Copy Markdown
Owner

Fixes #27

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.
@tarampampam tarampampam merged commit e765f4d into master Apr 14, 2026
9 checks passed
@tarampampam tarampampam deleted the feat/auto-retry branch April 14, 2026 16:44
@tarampampam tarampampam added the type:feature PR that introduces a new feature label Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:feature PR that introduces a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Auto retry on 503 (at least) errors

1 participant