{"record":{"id":"1362fef5e59dcc6e","repo":"ruvnet/ruflo","slug":"moe-failed-to-load-weights-err","errorCode":null,"errorMessage":"[MoE] Failed to load weights: ${err}","messagePattern":"\\[MoE\\] Failed to load weights: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/neural/src/moe-router.ts","lineNumber":650,"sourceCode":"      }\n\n      // Load weights\n      this.W1 = new Float32Array(model.weights.W1.flat());\n      this.b1 = new Float32Array(model.weights.b1);\n      this.W2 = new Float32Array(model.weights.W2.flat());\n      this.b2 = new Float32Array(model.weights.b2);\n\n      // Load stats\n      this.updateCount = model.stats.updateCount || 0;\n      this.avgReward = model.stats.avgReward || 0;\n      this.routingCounts = new Float32Array(\n        model.stats.routingCounts || new Array(NUM_EXPERTS).fill(0)\n      );\n      this.totalRoutings = this.routingCounts.reduce((a, b) => a + b, 0);\n\n      return true;\n    } catch (err) {\n      console.warn(`[MoE] Failed to load weights: ${err}`);\n      return false;\n    }\n  }\n\n  /**\n   * Save weights to persistence file\n   */\n  async saveWeights(path?: string): Promise<boolean> {\n    const weightsPath = path || this.config.weightsPath;\n    try {\n      // Ensure directory exists\n      const dir = dirname(weightsPath);\n      if (!existsSync(dir)) {\n        mkdirSync(dir, { recursive: true });\n      }\n\n      // Convert Float32Arrays to nested arrays for JSON\n      const W1_2d: number[][] = [];","sourceCodeStart":632,"sourceCodeEnd":668,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/neural/src/moe-router.ts#L632-L668","documentation":"Log warning in loadWeights: reading, parsing, or importing the persisted MoE router weights file threw; weights are not restored, the router keeps its freshly initialized state, and the failure reason is printed.","triggerScenarios":"Thrown at v3/@claude-flow/neural/src/moe-router.ts:650 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or remove the corrupted persisted MoE weights file; the router initializes fresh weights when loading fails."],"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"}