Skip to content

feat: add circuit breaker package for fault tolerance - #3982

Open
Zakariasisu5 wants to merge 1 commit into
docker:mainfrom
Zakariasisu5:main
Open

feat: add circuit breaker package for fault tolerance#3982
Zakariasisu5 wants to merge 1 commit into
docker:mainfrom
Zakariasisu5:main

Conversation

@Zakariasisu5

Copy link
Copy Markdown
  • Implement three-state circuit breaker (Closed/Open/Half-Open) for resilience
  • Add configurable thresholds for failure detection and recovery testing
  • Include timeout-based recovery with exponential backoff integration
  • Thread-safe concurrent access with RWMutex
  • Comprehensive test coverage (14 test cases)
  • Practical examples for LLM APIs, MCP servers, and HTTP tools
  • Full documentation with configuration guidance and best practices

The circuit breaker prevents cascading failures by fast-failing when external services (LLM providers, MCP servers, HTTP tools) are known to be down. This is essential for docker-agent's reliability, reducing unnecessary load during service degradation and improving user experience.

Key features:

  • Automatic recovery testing in half-open state
  • Capacity limits for concurrent test requests
  • Statistics tracking for monitoring
  • Context cancellation support

- Implement three-state circuit breaker (Closed/Open/Half-Open) for resilience
- Add configurable thresholds for failure detection and recovery testing
- Include timeout-based recovery with exponential backoff integration
- Thread-safe concurrent access with RWMutex
- Comprehensive test coverage (14 test cases)
- Practical examples for LLM APIs, MCP servers, and HTTP tools
- Full documentation with configuration guidance and best practices

The circuit breaker prevents cascading failures by fast-failing when external
services (LLM providers, MCP servers, HTTP tools) are known to be down. This is
essential for docker-agent's reliability, reducing unnecessary load during
service degradation and improving user experience.

Key features:
- Automatic recovery testing in half-open state
- Capacity limits for concurrent test requests
- Statistics tracking for monitoring
- Context cancellation support
@Zakariasisu5
Zakariasisu5 requested a review from a team as a code owner August 14, 2026 02:51
@aheritier aheritier added area/docs Documentation changes area/testing Test infrastructure, CI/CD, test runners, evaluation kind/feat PR adds a new feature (maps to feat:). Use on PRs only. status/needs-signed-commits Some commits in the PR are signed with a valid SSH/GPG key labels Aug 17, 2026
@aheritier

Copy link
Copy Markdown
Collaborator

👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push.

Commits that are not verified: 113004a

See GitHub's guide on signing commits for setup instructions. I've added status/needs-signed-commits; it will be removed automatically once every commit in this PR carries a valid GitHub-verified signature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/docs Documentation changes area/testing Test infrastructure, CI/CD, test runners, evaluation kind/feat PR adds a new feature (maps to feat:). Use on PRs only. status/needs-signed-commits Some commits in the PR are signed with a valid SSH/GPG key

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants