ruvnet/ruflo · error · CircuitBreakerOpenError
BACKEND_UNAVAILABLE
BACKEND_UNAVAILABLE
Error message
Circuit breaker is open
What it means
CircuitBreaker.execute() saw state 'open' and the retry deadline (nextAttemptAt) has not yet elapsed, so the call is failed-fast instead of hitting the presumably-failing backend. This is the breaker doing its job: repeated backend failures tripped it, and the error carries the breaker state for callers to back off.
Source
Thrown at v3/plugins/teammate-plugin/src/utils/circuit-breaker.ts:69
lastSuccess: null,
openedAt: null,
nextAttemptAt: null,
};
}
/**
* Execute a function with circuit breaker protection
*/
async execute<T>(fn: () => Promise<T>): Promise<T> {
if (!this.config.enabled) {
return fn();
}
if (this.state.state === 'open') {
if (this.state.nextAttemptAt && Date.now() >= this.state.nextAttemptAt.getTime()) {
this.state.state = 'half-open';
} else {
throw new CircuitBreakerOpenError(
'Circuit breaker is open',
TeammateErrorCode.BACKEND_UNAVAILABLE,
this.state.nextAttemptAt ?? undefined
);
}
}
try {
const result = await Promise.race([
fn(),
new Promise<never>((_, reject) =>
setTimeout(() => reject(new Error('Circuit breaker timeout')), this.config.timeoutMs)
),
]);
this.recordSuccess();
return result;
} catch (error) {View on GitHub (pinned to fa13ee4ad6)
Solutions
- Wait for the circuit breaker cooldown period to elapse, then retry the operation.
- Investigate and fix the downstream failures that tripped the breaker before forcing it closed.
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at v3/plugins/teammate-plugin/src/utils/circuit-breaker.ts:69 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18).
Data as JSON: /api/errors/a2aca0b765e2f6b4.
Report an issue: GitHub.