{"record":{"id":"720b60a84d8a40b3","repo":"deepseek-ai/deepseek-harness","slug":"ralph-workflow-returned-an-unknown-terminal-status","errorCode":null,"errorMessage":"Ralph workflow returned an unknown terminal status","messagePattern":"Ralph workflow returned an unknown terminal status","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/workflow/tool-ralph/src/index.ts","lineNumber":331,"sourceCode":"        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':\n      return `Ralph workflow was cancelled${result.error === undefined ? '' : ` (${result.error})`}`\n    case 'error':\n      return `Ralph workflow failed: ${result.error ?? 'unknown error'}`\n    /* v8 ignore start -- WorkflowStopReason is closed; a future variant must fail loud here. */\n    default:\n      return `Ralph workflow ended abnormally (${String(result.stopReason satisfies never)})`\n    /* v8 ignore stop */\n  }\n}","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/tool-ralph/src/index.ts#L313-L349","documentation":"Error \"Ralph workflow returned an unknown terminal status\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/tool-ralph/src/index.ts:331 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Return one of the known terminal statuses from the Ralph workflow; add handling for the returned status if a new one was introduced."],"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"}