跳转到主要内容
此内容尚未提供您的语言版本,正在以英文显示。

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

工作流

  1. Build the Capability Map
  2. Initialize Circuit Breaker State
  3. Implement the Call-and-Track Loop
  4. Route to Alternatives on Open Circuit
  5. Reduce Scope to Achievable Work
  6. Handle Staleness and Label Data Quality
  7. Enforce the Failure Budget
  8. Separation of Concerns — Expeditor vs. Executor
  9. Detect Cascading Failures
  10. Pre-Call Tool Selection Layer

实践

  • Resilience
  • Circuit-breaker
  • Error-handling
  • Graceful-degradation
  • Tool-reliability
  • Fault-tolerance

安装

/plugin install agent-almanac@pjt222-agent-almanac

质量评分

已验证
100 /100
about 24 hours ago 分析

信任信号

最近提交2 days ago
星标14
许可证MIT
状态
查看源代码

类似扩展

Error Handling Patterns

95

Master 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.

技能
wshobson

Fail Early Pattern

99

Apply 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.

技能
pjt222

Cleanup Defensive

99

Remove 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".

技能
raintree-technology

Agent Introspection Debugging

99

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports.

技能
affaan-m

Workflow Orchestration Patterns

99

Design 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.

技能
wshobson

Chaos Engineer

99

Designs 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.

技能
jeffallan