Circuit breaking contains a failing external tool by stopping repeated calls, returning a controlled outcome, and probing recovery before restoring normal traffic.
A local agent may depend on a cloud model, search API, notification service, or remote smart-home bridge while the rest of its workflow runs correctly. Without a containment boundary, one slow dependency can consume the agent's time budget and provoke more retries. A circuit breaker turns that uncertain remote condition into explicit local state that the orchestrator can reason about.
The Breaker Sits Between Tool Selection and External Execution
An agent normally selects a tool, validates its arguments, and hands the call to an executor, while circuit breaking adds a stateful wrapper at that last boundary. It does not change what the model requested; it decides whether the executor should contact the dependency, reject the attempt locally, or admit a limited recovery probe.
The wrapper observes completed calls and classifies outcomes such as success, timeout, transport failure, rate limiting, or another configured failure signal. A conventional circuit breaker pattern wraps remote calls, tracks failures, opens after a threshold, and later permits test requests, keeping dependency health outside the model's prompt-level judgment.
The immediate output is therefore not merely a tool exception. It is a structured orchestration result containing the breaker state, whether execution was attempted, and which continuation paths remain allowed.
Recent Failures Are Compressed Into a State Transition
While closed, the breaker passes calls and records only the outcomes relevant to its policy, so one isolated timeout does not necessarily disable a useful tool. Implementations commonly evaluate a recent count, rate, or time window and open only when that local evidence crosses the configured failure or slow-call threshold.
The threshold converts many noisy events into one stable control decision. An error-rate threshold can cap connection churn during a network failure instead of letting every requested operation establish another doomed connection.
What counts as failure must match the tool's contract. Authentication denial, malformed arguments, and a permanently missing resource usually need different handling from latency, temporary unavailability, or rate limiting.
A percentage threshold also needs enough observations to be meaningful. Opening after one failure makes a lightly used tool unstable, while waiting for a large sample can leave a frequently failing dependency active too long, so the sampling window and minimum-call requirement belong to the breaker policy rather than to the language model.
An Open Circuit Converts Remote Waiting Into Local Failure
After the breaker opens, the executor stops contacting that dependency for an explicit cooling interval, so new attempts fail locally instead of waiting through another remote timeout. Healthy local tools, retrieval steps, and reasoning turns can continue without inheriting the failed dependency's latency.
This fail-fast path contains resource pressure as well as delay because repeated remote calls can hold sockets, worker slots, memory, or queued tasks while they wait. Rejecting operations before they allocate more external-call capacity reduces resource exhaustion during a persistent outage.
Containment is selective rather than global. A breaker should normally be scoped to one dependency and often one operation class, because reads and writes may have different failure costs.
Retries and Timeouts Change What the Breaker Observes
A retry handles a failure believed to be transient, whereas a circuit breaker remembers that failures have become persistent enough to stop trying, so their ordering changes the evidence seen by the breaker. Retries inside one protected execution may count as one logical call, while retries outside the breaker may each add another failure sample.
Timeouts also define when a slow call becomes a failure sample. Resilience patterns separate timeouts, retries, and circuit breakers because each control owns a different failure boundary.
This separation becomes critical when the tool has non-idempotent side effects. The same repeated tool-call loops can originate in model decisions or retry layers below the model, and a breaker cannot prove whether a timed-out write already changed the external system.
A safe execution path therefore records the retry budget and the breaker state separately, so the orchestrator can explain whether an action was never attempted, attempted once, or blocked after repeated dependency failures.
Fallbacks Preserve Workflow Meaning Without Pretending the Tool Worked
Opening the circuit only answers whether the primary tool may run, while the orchestrator still needs a continuation policy that preserves the user's intent. Depending on the task, it may return partial results, use cached read data, switch providers, queue the task, request human review, or stop.
A fallback must carry degradation metadata rather than masquerading as the original result. Downstream steps can restrict high-impact actions when they are operating on stale cached content or substituted evidence.
Some calls have no safe fallback. A notification can be queued, but a door-control command should not be replaced by a guessed state, and a backup deletion should not be inferred from cached inventory.
Half-Open Probes Restore Access Without Releasing a Retry Wave
An open circuit cannot remain closed to traffic forever because the external tool may recover, so after a cooling interval the breaker admits only a small number of trial calls. Normal workload remains blocked until those probes provide evidence that the dependency can safely accept traffic again.
Successful probes move the breaker toward closed, while failed probes reopen it and restart the waiting period. Monitoring circuit breaker states makes repeated openings and long recovery periods visible instead of burying them inside tool errors.
A successful health probe is not automatically a safe replay of an earlier write. The dependency may answer a read check while an earlier side effect remains ambiguous, so idempotency keys, checkpoints, reconciliation, and approval boundaries still govern whether interrupted actions may resume.
Probe admission is intentionally narrower than normal traffic because recovery evidence becomes less useful if hundreds of waiting requests hit the dependency at once. Limiting concurrent probes prevents the breaker itself from creating the surge that makes a newly recovered tool look unhealthy again.
Tech & AI HUB
More to Read

Runtime State vs Persistent State in Home Assistant: What Must Survive Restart?
Home Assistant does not persist every live value; config, registries, selected restored states, history, and deployment data play different restart roles.

How Does Home Assistant Authenticate Local and Remote Sessions?
Local and remote Home Assistant sessions use the same server-side identity model; remote access changes the route and TLS boundary, not the core token...

Why Can Home Assistant History Queries Slow as Recorder Data Grows?
Recorder growth can raise History query cost when the requested range touches more rows, cache misses increase, or storage and index work become slower.

