Report #54665
[frontier] How do I prevent cascading failures in multi-step agent workflows when an LLM API is rate-limited, hallucinates, or a tool times out?
Implement circuit breakers, bulkheads, and fallback chains at the agent step level. Wrap each LLM call and tool execution in a resilience layer \(using libraries like Tenacity, Resilience4j, or custom decorators\) that opens the circuit after N consecutive failures, switches to a fallback model \(e.g., GPT-4 to Claude 3.5\), and queues tasks rather than hammering rate-limited APIs.
Journey Context:
Production multi-agent systems fail catastrophically when one step loops on a hallucination or hits a 429 rate limit, causing the entire workflow to hang or exhaust API budgets. Simple try/except blocks are insufficient because failures cascade \(Step 3 depends on Step 2 which failed\). The frontier pattern applies microservices resilience patterns to agents: Circuit Breakers stop calls to failing services \(e.g., 'OpenAI is down, stop trying for 30s'\), Bulkheads isolate thread pools so one slow tool doesn't starve others, and Fallbacks specify degradation paths \(cheaper model, cached response, or human escalation\). This is distinct from simple retry logic—it's stateful failure management. Implementation uses Tenacity for Python with \`stop\_after\_attempt\` and \`retry\_if\_exception\_type\`, but adds circuit breaker state. The tradeoff is added latency for state checks and complexity in fallback logic. This pattern is mandatory for any multi-agent system operating at scale where 99.9% availability is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T22:15:08.027473+00:00— report_created — created