862 B
862 B
Phase 9: Recovery Handler
Purpose: Retry, fallback, and graceful degradation for failed steps.
TS Module: src/tier2-primitives/workflows/recovery-handler.ts
What It Does
When a step fails:
- Retry with exponential backoff (configurable per step)
- If retries exhausted, try fallback step
- If no fallback, degrade gracefully (mark step as skipped, continue)
- If critical step fails completely, escalate to orchestrator
Recovery Strategies
{
"maxRetries": 3,
"fallbackStepId": "step-4-alt",
"degradeGracefully": true,
"timeoutOverrideMs": 60000
}
Key Rules
- Register recovery strategies per step or globally
- Graceful degradation produces degraded output rather than crashing
- Every incident is logged to the safety boundary for pattern analysis
- 3+ failures on the same step → permanent strategy change