{"record":{"id":"30d2cc7677258f57","repo":"deepseek-ai/deepseek-harness","slug":"ralph-workflow-returned-a-round-failure-without-it","errorCode":null,"errorMessage":"Ralph workflow returned a round failure without its last handoff","messagePattern":"Ralph workflow returned a round failure without its last handoff","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflow/tool-ralph/src/index.ts","lineNumber":322,"sourceCode":"      if (Object.keys(value).sort().join(',') !== 'report,roundsStarted,status') {\n        throw new Error('Ralph workflow returned a malformed terminal result')\n      }\n      if (roundsStarted !== maxRounds) {\n        throw new Error('Ralph workflow returned budget-limited before the round limit')\n      }\n      return { status: 'budget-limited', roundsStarted, report: readReport(value['report'], 'continue', maxHandoffChars) }\n    case 'round-failed': {\n      if (Object.keys(value).sort().join(',') !== 'lastReport,roundsStarted,status') {\n        throw new Error('Ralph workflow returned a malformed terminal result')\n      }\n      if (roundsStarted === 1) {\n        if (value['lastReport'] !== null) {\n          throw new Error('Ralph workflow returned an invalid first-round failure')\n        }\n        return { status: 'round-failed', roundsStarted }\n      }\n      if (value['lastReport'] === null) {\n        throw new Error('Ralph workflow returned a round failure without its last handoff')\n      }\n      return {\n        status: 'round-failed',\n        roundsStarted,\n        lastReport: readReport(value['lastReport'], 'continue', maxHandoffChars),\n      }\n    }\n    default:\n      throw new Error('Ralph workflow returned an unknown terminal status')\n  }\n}\n\n/** A non-clean workflow finish is an error, never a partial Ralph success. */\nfunction stopReasonError(result: WorkflowResult): string | undefined {\n  switch (result.stopReason) {\n    case 'completed':\n      return undefined\n    case 'cancelled':","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/tool-ralph/src/index.ts#L304-L340","documentation":"Error \"Ralph workflow returned a round failure without its last handoff\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/tool-ralph/src/index.ts:322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure a failed round still carries its last handoff in the result; fix the workflow's failure-result assembly."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}