[Feature] Task retry and error recovery
JackChen-me/open-multi-agent
## Summary
Add configurable retry logic and error recovery strategies for failed tasks.
## Motivation
In production environments, LLM API calls can fail due to rate limits, timeouts, or transient errors. Currently, a failed task triggers `cascadeFailure()` which marks all downstream tasks as failed. This is correct but aggressive — many failures are recoverable.
## Proposed Approach
- Add `retryPolicy` to task configuration:
```typescript
{
maxRetries: 3,
backoff: 'exponential', // or 'linear', 'fixed'
retryableErrors: ['rate_limit', 'timeout'],
}
```
- Retry at the task level (re-run the agent with the same prompt)
- Only cascade failure after all retries are exhausted
- Emit retry events for observability
## Acceptance Criteria
- [ ] Configurable retry count and backoff strategy
- [ ] Distinguish retryable vs non-retryable errors
- [ ] Retry events emitted for monitoring
- [ ] Tests for retry and eventual failure scenarios
View on GitHub ↗
SaaS Metrics