feat: add retry logic for transient failures
- @with_retry decorator and retry_async() function - Exponential backoff with jitter - Retries on: timeout, connection errors, HTTP 429/5xx - Web search tool now retries on network failures - Configurable via RETRY_MAX_ATTEMPTS, RETRY_BASE_DELAY, RETRY_MAX_DELAY - 29 new tests (205 total passing) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -90,6 +90,11 @@ class Settings(BaseSettings):
|
||||
summarization_target_tokens: int = 500 # Target summary size
|
||||
keep_recent_messages: int = 6 # Messages to keep unsummarized (3 turns)
|
||||
|
||||
# Retry logic
|
||||
retry_max_attempts: int = 3 # Max retry attempts for transient failures
|
||||
retry_base_delay: float = 1.0 # Base delay in seconds
|
||||
retry_max_delay: float = 30.0 # Maximum delay in seconds
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env",
|
||||
case_sensitive=False,
|
||||
|
||||
Reference in New Issue
Block a user