deepseek-ai/deepseek-harness · error · Error

.mode must be "normal" or "always

Error message

${path}.mode must be "normal" or "always"

What it means

Retry-policy config validation: the policy `mode` is neither 'normal' nor 'always' (typo or unknown mode from config). The switch's default raises this at resolution time; merge-extensible unions would fall through instead — this union is closed.

Solutions

  1. Set mode to "normal" or "always".
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/llm/llm/src/retry-policy.ts:193 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/2061859e03db6a4f. Report an issue: GitHub.

Appendix: source

Thrown at packages/llm/llm/src/retry-policy.ts:193

      }
      if (new Set(retryableCodes).size !== retryableCodes.length) {
        throw new Error(`${path}.retryableCodes must not contain duplicates`)
      }
      return Object.freeze({
        mode: 'normal',
        maxRetries,
        retryableCodes: Object.freeze([...retryableCodes]),
        ...resolveBackoff(config.backoff, `${path}.backoff`),
      })
    }
    case 'always':
      validateKeys(config, ALWAYS_POLICY_KEYS, path)
      return Object.freeze({
        mode: 'always',
        ...resolveBackoff(config.backoff, `${path}.backoff`),
      })
    default:
      throw new Error(`${path}.mode must be "normal" or "always"`)
  }
}

View on GitHub (pinned to b150a551b8)