Skip to main content
Every tool call is automatically protected by a circuit breaker that stops repeated failures from wasting time.
Sync and Async Parity: Circuit breaker protection now applies uniformly to both sync and async tool execution paths. Previously, async calls bypassed circuit breaker checks.
This tool-level circuit breaker is separate from the new LLM idle-timeout circuit breaker, which protects against LLM provider stalls during model calls.
The user triggers a flaky tool; repeated failures open the breaker so later calls fail fast instead of looping on errors.

Quick Start

1

Works by default

Circuit breaker protection is automatically enabled for every tool call with zero configuration needed.
2

Detect open circuit

When a tool fails 5 times consecutively, subsequent calls return an error dictionary instead of calling the tool.
3

Tune or reset

Customize circuit breaker behavior or reset all breakers between test runs.

How It Works


Configuration Options


What Does NOT Trip the Breaker

Circuit breakers ignore certain error types to avoid false positives:
  • Approval denied errors - User permission issues don’t indicate tool problems
  • Permission denied errors - Access control failures aren’t tool failures
  • Approval process errors - User workflow issues shouldn’t trigger circuit breaking
These errors are handled normally by the agent without affecting circuit breaker state.

Common Patterns

Monitor circuit breaker health and statistics for debugging.

Best Practices

Circuit breakers prevent cascading failures and protect system stability. Keep them enabled in production environments to ensure reliable agent operation.
Track circuit breaker statistics in your monitoring systems. Frequent openings indicate underlying tool reliability issues that need attention.
Call reset_all_circuit_breakers() in test teardown to ensure clean state. This prevents test failures from affecting subsequent test runs.
When handling circuit_open: true responses, provide clear user feedback about temporary tool unavailability and suggest retry timeframes or alternative approaches.

Model Failover

Automatic LLM provider switching

Error Handling

Comprehensive error handling strategies