feat: add exponential backoff retry for transient SDK errors (rebased #127)#170
Merged
RichardAtCT merged 4 commits intomainfrom Mar 30, 2026
Merged
feat: add exponential backoff retry for transient SDK errors (rebased #127)#170RichardAtCT merged 4 commits intomainfrom
RichardAtCT merged 4 commits intomainfrom
Conversation
Closes #60 - adds configurable retry logic to ClaudeSDKManager.execute_command() for transient CLIConnectionError failures (non-MCP). Changes: - src/utils/constants.py: 4 new retry default constants - src/config/settings.py: 4 new settings fields (claude_retry_max_attempts, claude_retry_base_delay, claude_retry_backoff_factor, claude_retry_max_delay) - src/claude/sdk_integration.py: _is_retryable_error() helper + retry loop wrapping asyncio.wait_for() in execute_command() Retry decision: - CLIConnectionError (non-MCP): retried with exponential backoff - asyncio.TimeoutError: not retried (user-configured timeout, intentional) - CLINotFoundError, ProcessError, CLIJSONDecodeError: not retried Default backoff: 1s → 3s → 9s, capped at 30s (CLAUDE_RETRY_MAX_ATTEMPTS=0 disables) Tests: 491 passed, 0 failed
…d validation, retry tests
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
CLIConnectionErrorinexecute_command()Conflict Resolution
messages.clear()at top of loop prevents partial message pollutionCloses #60
Original PR: #127
Test plan