{"record":{"id":"e613f2741a219259","repo":"ruvnet/ruflo","slug":"failed-to-leave-hive","errorCode":null,"errorMessage":"Failed to leave hive","messagePattern":"Failed to leave hive","errorType":"exception","errorClass":"QEHiveError","httpStatus":null,"severity":"error","filePath":"v3/plugins/agentic-qe/src/bridges/QEHiveBridge.ts","lineNumber":483,"sourceCode":"      // Remove all spawned workers\n      for (const [workerId] of this.spawnedWorkers) {\n        try {\n          await this.hiveMind.leave(workerId);\n          this.logger.debug(`Worker removed: ${workerId}`);\n        } catch {\n          // Best effort cleanup\n        }\n      }\n      this.spawnedWorkers.clear();\n\n      // Remove queen\n      await this.hiveMind.leave(this.queenId);\n      this.initialized = false;\n\n      this.logger.info('QE Queen left hive successfully');\n    } catch (error) {\n      this.logger.error('Error leaving hive', error);\n      throw new QEHiveError('Failed to leave hive', error as Error);\n    }\n  }\n\n  /**\n   * Broadcast task to allocated workers\n   */\n  private async broadcastTask(task: QESwarmTask): Promise<void> {\n    await this.hiveMind.broadcast({\n      message: JSON.stringify({\n        type: 'qe-task',\n        taskId: task.id,\n        taskType: task.type,\n        payload: task.payload,\n        timeout: task.timeout,\n        assignedAgents: task.agents,\n      }),\n      priority: task.priority === 'critical' ? 'critical' : 'normal',\n      fromId: this.queenId,","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/agentic-qe/src/bridges/QEHiveBridge.ts#L465-L501","documentation":"Teardown failed on the queen's hiveMind.leave (worker removals are best-effort and swallowed, but the queen leave itself rejected, e.g. backend unreachable). initialized may stay true and hive resources leak.","triggerScenarios":"Thrown at v3/plugins/agentic-qe/src/bridges/QEHiveBridge.ts:483 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the bridge is still registered before leaving the hive.","Make leave idempotent so repeated calls do not fail."],"exampleFix":null,"handlingStrategy":"try-catch","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-14T05:17:10.506Z"}