feat: add retry logic for transient failures
Build and Push API / release (push) Successful in 3s
Build and Push API / build (push) Successful in 1m14s

- @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:
2026-01-11 23:22:16 +01:00
co-authored by Claude Opus 4.5
parent 2f97041aa9
commit acf231eb66
8 changed files with 509 additions and 12 deletions
+4 -2
View File
@@ -126,7 +126,7 @@ Last updated: 2026-01-11
| **Todo tracking** | CLI | Built-in task list (`/todo`) | Medium |
| **Git integration** | CLI | Auto-commit, branch management | Medium |
| **Agent handoff** | Orchestration | Explore → Plan → Task workflow | High |
| **Retry logic** | Infrastructure | Auto-retry on tool failures | Low |
| ~~**Retry logic**~~ | Infrastructure | Auto-retry with exponential backoff | Low |
### Low Priority
@@ -151,11 +151,12 @@ Last updated: 2026-01-11
| Task agent tests | 15 | 15 | ✅ |
| Conversation tests | 19 | 19 | ✅ |
| Token tests | 6 | 6 | ✅ |
| Retry tests | 29 | 29 | ✅ |
| Security tests | 14 | 14 | ✅ |
| Integration tests | 10 | 10 | ✅ Agent + real LLM |
| E2E tests | 12 | 12 | ✅ Full API workflow |
**Total: 176 tests passing**
**Total: 205 tests passing**
**Test breakdown:**
- Read/Glob/Grep tools: 17 tests
@@ -168,6 +169,7 @@ Last updated: 2026-01-11
- Task agent: 15 tests
- Conversations: 19 tests
- Tokens: 6 tests
- Retry: 29 tests
- Security: 14 tests
- Health checks: 2 tests
- Integration (LLM): 10 tests
+3
View File
@@ -217,6 +217,9 @@ All settings via environment variables or `.env`:
| SUMMARIZATION_THRESHOLD | 0.8 | Summarize at N% of max tokens |
| SUMMARIZATION_TARGET_TOKENS | 500 | Target summary size |
| KEEP_RECENT_MESSAGES | 6 | Messages to keep unsummarized |
| RETRY_MAX_ATTEMPTS | 3 | Max retry attempts for transient failures |
| RETRY_BASE_DELAY | 1.0 | Base delay between retries (seconds) |
| RETRY_MAX_DELAY | 30.0 | Maximum delay between retries (seconds) |
---