deepseek-ai/deepseek-harness · error · Error
Ralph workflow returned a malformed terminal result
Error message
Ralph workflow returned a malformed terminal result
What it means
Error "Ralph workflow returned a malformed terminal result" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/workflow/tool-ralph/src/index.ts:289
}
if (expectedStatus === 'blocked' && !normalizedText(report.blocker)) {
throw new Error('Ralph workflow returned an invalid blocked report')
}
const chars = JSON.stringify(report).length
if (chars > maxChars) {
throw new Error(`Ralph workflow returned an oversized handoff (${chars} > ${maxChars})`)
}
return report
}
/** Defensively decode the fixed script's terminal value. */
function readRunResult(value: unknown, maxRounds: number, maxHandoffChars: number): RalphTerminalResult {
if (!isRecord(value)
|| typeof value['roundsStarted'] !== 'number'
|| !Number.isSafeInteger(value['roundsStarted'])
|| value['roundsStarted'] < 1
|| value['roundsStarted'] > maxRounds) {
throw new Error('Ralph workflow returned a malformed terminal result')
}
const roundsStarted = value['roundsStarted']
switch (value['status']) {
case 'complete':
if (Object.keys(value).sort().join(',') !== 'report,roundsStarted,status') {
throw new Error('Ralph workflow returned a malformed terminal result')
}
return { status: 'complete', roundsStarted, report: readReport(value['report'], 'complete', maxHandoffChars) }
case 'blocked':
if (Object.keys(value).sort().join(',') !== 'report,roundsStarted,status') {
throw new Error('Ralph workflow returned a malformed terminal result')
}
return { status: 'blocked', roundsStarted, report: readReport(value['report'], 'blocked', maxHandoffChars) }
case 'budget-limited':
if (Object.keys(value).sort().join(',') !== 'report,roundsStarted,status') {
throw new Error('Ralph workflow returned a malformed terminal result')
}
if (roundsStarted !== maxRounds) {View on GitHub (pinned to b150a551b8)
Solutions
- Fix the Ralph workflow's terminal result so it matches the expected status/result contract; inspect the returned value in the session log.
When it happens
Trigger: Thrown at packages/workflow/tool-ralph/src/index.ts:289 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/6753d80ec180065d.
Report an issue: GitHub.