deepseek-ai/deepseek-harness · error · Error

Ralph workflow returned a round failure without its last…

Error message

Ralph workflow returned a round failure without its last handoff

What it means

Thrown while decoding a Ralph workflow terminal result of kind 'round-failed'. The result object's keys were validated as exactly lastReport,roundsStarted,status, so this guard fires when the accompanying lastReport is absent or cannot be read: a round-failed outcome is required to carry the report of the round that failed so the caller can inspect what was attempted. The workflow provider returned a round failure without that evidence.

Solutions

  1. Ensure a failed round still carries its last handoff in the result; fix the workflow's failure-result assembly.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/workflow/tool-ralph/src/index.ts:322 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/30d2cc7677258f57. Report an issue: GitHub.

Appendix: source

Thrown at packages/workflow/tool-ralph/src/index.ts:322

      if (Object.keys(value).sort().join(',') !== 'report,roundsStarted,status') {
        throw new Error('Ralph workflow returned a malformed terminal result')
      }
      if (roundsStarted !== maxRounds) {
        throw new Error('Ralph workflow returned budget-limited before the round limit')
      }
      return { status: 'budget-limited', roundsStarted, report: readReport(value['report'], 'continue', maxHandoffChars) }
    case 'round-failed': {
      if (Object.keys(value).sort().join(',') !== 'lastReport,roundsStarted,status') {
        throw new Error('Ralph workflow returned a malformed terminal result')
      }
      if (roundsStarted === 1) {
        if (value['lastReport'] !== null) {
          throw new Error('Ralph workflow returned an invalid first-round failure')
        }
        return { status: 'round-failed', roundsStarted }
      }
      if (value['lastReport'] === null) {
        throw new Error('Ralph workflow returned a round failure without its last handoff')
      }
      return {
        status: 'round-failed',
        roundsStarted,
        lastReport: readReport(value['lastReport'], 'continue', maxHandoffChars),
      }
    }
    default:
      throw new Error('Ralph workflow returned an unknown terminal status')
  }
}

/** A non-clean workflow finish is an error, never a partial Ralph success. */
function stopReasonError(result: WorkflowResult): string | undefined {
  switch (result.stopReason) {
    case 'completed':
      return undefined
    case 'cancelled':

View on GitHub (pinned to b150a551b8)