{"record":{"id":"a2aca0b765e2f6b4","repo":"ruvnet/ruflo","slug":"backend-unavailable","errorCode":"BACKEND_UNAVAILABLE","errorMessage":"Circuit breaker is open","messagePattern":"Circuit breaker is open","errorType":"exception","errorClass":"CircuitBreakerOpenError","httpStatus":null,"severity":"error","filePath":"v3/plugins/teammate-plugin/src/utils/circuit-breaker.ts","lineNumber":69,"sourceCode":"      lastSuccess: null,\n      openedAt: null,\n      nextAttemptAt: null,\n    };\n  }\n\n  /**\n   * Execute a function with circuit breaker protection\n   */\n  async execute<T>(fn: () => Promise<T>): Promise<T> {\n    if (!this.config.enabled) {\n      return fn();\n    }\n\n    if (this.state.state === 'open') {\n      if (this.state.nextAttemptAt && Date.now() >= this.state.nextAttemptAt.getTime()) {\n        this.state.state = 'half-open';\n      } else {\n        throw new CircuitBreakerOpenError(\n          'Circuit breaker is open',\n          TeammateErrorCode.BACKEND_UNAVAILABLE,\n          this.state.nextAttemptAt ?? undefined\n        );\n      }\n    }\n\n    try {\n      const result = await Promise.race([\n        fn(),\n        new Promise<never>((_, reject) =>\n          setTimeout(() => reject(new Error('Circuit breaker timeout')), this.config.timeoutMs)\n        ),\n      ]);\n\n      this.recordSuccess();\n      return result;\n    } catch (error) {","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/teammate-plugin/src/utils/circuit-breaker.ts#L51-L87","documentation":"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.","triggerScenarios":"Thrown at v3/plugins/teammate-plugin/src/utils/circuit-breaker.ts:69 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}