{"record":{"id":"5e6e5d10dbd56032","repo":"ruvnet/ruflo","slug":"resume-failed-to-load-checkpoint-resumefrom","errorCode":null,"errorMessage":"--resume failed to load checkpoint ${resumeFrom}: ${(e as Error).message}","messagePattern":"--resume failed to load checkpoint (.+?): (.+?)","errorType":"exception","errorClass":"ResumeFailedError","httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/cli/src/services/native-training.ts","lineNumber":130,"sourceCode":"    let resumed = false;\n    let resumeMode: 'resumeFrom' | 'loadCheckpoint' | undefined;\n    if (resumeFrom) {\n      if (!existsSync(resumeFrom)) {\n        throw new ResumeFailedError(`--resume checkpoint not found: ${resumeFrom}`);\n      }\n      try {\n        if (typeof pipeline.resumeFrom === 'function') {\n          pipeline.resumeFrom(resumeFrom);\n          resumeMode = 'resumeFrom';\n        } else {\n          const ok = pipeline.loadCheckpoint(resumeFrom);\n          if (ok === false) throw new Error('loadCheckpoint returned false');\n          resumeMode = 'loadCheckpoint';\n        }\n        resumed = true;\n      } catch (e) {\n        if (e instanceof ResumeFailedError) throw e;\n        throw new ResumeFailedError(\n          `--resume failed to load checkpoint ${resumeFrom}: ${(e as Error).message}`,\n        );\n      }\n    }\n\n    // Pattern-alignment pairs, chunked into pipeline batches.\n    const inputs: number[][] = [];\n    const targets: number[][] = [];\n    const qualities: number[] = [];\n    for (let i = 0; i < embeddings.length; i++) {\n      inputs.push(Array.from(embeddings[i]));\n      targets.push(Array.from(embeddings[(i + 1) % embeddings.length]));\n      qualities.push(1.0);\n    }\n    for (let i = 0; i < inputs.length; i += batchSize) {\n      pipeline.addBatch(\n        inputs.slice(i, i + batchSize),\n        targets.slice(i, i + batchSize),","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/cli/src/services/native-training.ts#L112-L148","documentation":"The pipeline found the checkpoint file but failed to restore it: resumeFrom() (preferred, epoch position + optimizer state) or the loadCheckpoint() fallback (weights only) threw, or loadCheckpoint explicitly returned false. Wrapped in ResumeFailedError so an explicit --resume never degrades into a fresh run.","triggerScenarios":"Thrown at v3/@claude-flow/cli/src/services/native-training.ts:130 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the wrapped error message for the load failure cause","Re-create the checkpoint if it is corrupt, then resume from it"],"exampleFix":"Check the checkpoint file is intact and compatible with this version; if corrupted, resume from an earlier checkpoint or restart training.","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"}