Network-AI
Release

v5.6.1 — Circuit Breaker on AdapterRegistry

Published 2026-05-19 | Release notes

All 3,136 tests pass. Zero TypeScript errors.

Read the release here or open the original release on GitHub.

All 3,136 tests pass. Zero TypeScript errors.

Features

Circuit Breaker on AdapterRegistry (lib/circuit-breaker.ts)

A new standalone CircuitBreaker class with a three-state machine wired into every adapter in AdapterRegistry.

State machine

CLOSED ──(failureThreshold failures)──► OPEN
  ▲                                       │
  │ (successThreshold successes)    (recoveryTimeoutMs)
  │                                       ▼
  └────────────────────────── HALF_OPEN ──┤
                                          │ (failure)
                                          └──► OPEN
StateBehavior
CLOSEDNormal execution — failures increment counter
OPENCircuitOpenError thrown immediately — no call made to adapter
HALF_OPENOne probe call allowed — success closes, failure re-opens

Configuration

const registry = new AdapterRegistry({
  circuitBreaker: {
    failureThreshold: 3,       // trips after 3 consecutive failures (default)
    recoveryTimeoutMs: 30_000, // waits 30 s before probing (default)
    successThreshold: 1,       // 1 success in HALF_OPEN closes circuit (default)
    onStateChange: (from, to, adapterName) => console.log(`${adapterName}: ${from} → ${to}`),
  },
  fallbackChain: ['backup-agent', 'emergency-agent'],
});

Fallback chain

When the circuit is OPEN, the registry automatically tries each adapter in fallbackChain in order before returning a CIRCUIT_OPEN error code. This enables zero-downtime failover without changing any call site.

Public API

registry.getCircuitState('my-agent');        // 'CLOSED' | 'OPEN' | 'HALF_OPEN'
registry.resetCircuit('my-agent');           // force back to CLOSED
registry.setCircuitBreakerConfig({ failureThreshold: 5 });

New event types

circuit:open, circuit:half-open, circuit:close added to AdapterEventType.

Zero new runtime dependencies — BYOC principle maintained throughout.

13 new tests added to test-phase11.ts.

Release FAQ

Fast answers for operators and answer engines.

What changed in v5.6.1?

All 3,136 tests pass. Zero TypeScript errors.

When was v5.6.1 published?

v5.6.1 was published on May 19, 2026.

How much validation backed v5.6.1?

The release notes report 3,136 tests, all passing.

Continue evaluating

Cross-check the release signals.

Use the changelog, benchmark notes, and security policy together to validate that the release story lines up with public maintenance discipline.

Changelog Benchmarks Security