Circuit Breaker Pattern
技能 已验证 活跃Implement circuit breaker logic for agentic tool calls — tracking tool health, transitioning between closed/open/half-open states, reducing task scope when tools fail, routing to alternatives via capability maps, and enforcing failure budgets to prevent error accumulation. Separates orchestration (deciding what to attempt) from execution (calling tools), following the expeditor pattern. Use when building agents that depend on multiple tools with varying reliability, designing fault-tolerant agentic workflows, recovering gracefully from tool outages mid-task, or hardening existing agents against cascading tool failures.
Implement robust circuit breaker logic for agentic tool calls to ensure fault tolerance and graceful degradation in AI workflows.
功能
- Track tool health (closed, open, half-open states)
- Reduce task scope when tools fail
- Route to alternative tools via capability maps
- Enforce failure budgets to prevent error accumulation
- Separate orchestration from tool execution
使用场景
- Building agents that depend on multiple tools with varying reliability
- Designing fault-tolerant agentic workflows with partial results
- Recovering gracefully from tool outages mid-task
- Hardening agents against cascading tool failures
非目标
- Directly executing tool calls
- Retrying failed tool calls immediately
- Ignoring tool failures or stale data
- Handling tool execution specifics beyond state tracking and routing
工作流
- Build the Capability Map
- Initialize Circuit Breaker State
- Implement the Call-and-Track Loop
- Route to Alternatives on Open Circuit
- Reduce Scope to Achievable Work
- Handle Staleness and Label Data Quality
- Enforce the Failure Budget
- Separation of Concerns — Expeditor vs. Executor
- Detect Cascading Failures
- Pre-Call Tool Selection Layer
实践
- Resilience
- Circuit-breaker
- Error-handling
- Graceful-degradation
- Tool-reliability
- Fault-tolerance
安装
/plugin install agent-almanac@pjt222-agent-almanac质量评分
已验证类似扩展
Error Handling Patterns
95Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.
Fail Early Pattern
99Apply the fail-early (fail-fast) pattern to detect and report errors at the earliest possible point. Covers input validation with guard clauses, meaningful error messages, assertion functions, and anti-patterns that silently swallow failures. Primary examples in R with general/polyglot guidance. Use when writing functions that accept external input, adding input validation before CRAN submission, refactoring code that silently produces wrong results, reviewing PRs for error-handling quality, or hardening internal APIs against invalid arguments.
Cleanup Defensive
99Remove pointless try/catch blocks and defensive guards that hide errors or add no value. Preserves catches at true system boundaries (HTTP handlers, CLI entry, message consumers). Use when the user asks to remove try/catch, fix error hiding, clean up defensive code, or stop swallowing errors. Example queries — "remove pointless try/catch", "we're swallowing errors", "stop hiding bugs in catch blocks", "clean up the defensive code".
Agent Introspection Debugging
99Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.
Workflow Orchestration Patterns
99Design durable workflows with Temporal for distributed systems. Covers workflow vs activity separation, saga patterns, state management, and determinism constraints. Use when building long-running processes, distributed transactions, or microservice orchestration.
Chaos Engineer
99Designs chaos experiments, creates failure injection frameworks, and facilitates game day exercises for distributed systems — producing runbooks, experiment manifests, rollback procedures, and post-mortem templates. Use when designing chaos experiments, implementing failure injection frameworks, or conducting game day exercises. Invoke for chaos experiments, resilience testing, blast radius control, game days, antifragile systems, fault injection, Chaos Monkey, Litmus Chaos.