deepseek-ai/deepseek-harness · error · Error
.maxRetries must be a non-negative safe integer
Error message
${path}.maxRetries must be a non-negative safe integer What it means
Retry-policy config validation: mode 'normal' requires maxRetries to be a non-negative safe integer (after defaults). Resolved at configuration time; the error names the config path so the offending policy block is identifiable.
Solutions
- Set maxRetries to a non-negative safe integer
- Remove the override to accept DEFAULT_MAX_RETRIES
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/llm/llm/src/retry-policy.ts:168 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/11e45dd7e5ba9da4.
Report an issue: GitHub.
Appendix: source
Thrown at packages/llm/llm/src/retry-policy.ts:168
config: RetryPolicyConfig | undefined,
path: string,
): ResolvedRetryPolicy {
if (config === undefined) {
return Object.freeze({
mode: 'normal',
maxRetries: DEFAULT_MAX_RETRIES,
retryableCodes: DEFAULT_RETRYABLE_CODES,
...resolveBackoff(undefined, `${path}.backoff`),
})
}
switch (config.mode) {
case 'normal': {
validateKeys(config, NORMAL_POLICY_KEYS, path)
const maxRetries = config.maxRetries ?? DEFAULT_MAX_RETRIES
const retryableCodes = config.retryableCodes ?? [...DEFAULT_RETRYABLE_CODES]
if (!Number.isSafeInteger(maxRetries) || maxRetries < 0) {
throw new Error(`${path}.maxRetries must be a non-negative safe integer`)
}
if (retryableCodes.length === 0) {
throw new Error(`${path}.retryableCodes must not be empty`)
}
if (retryableCodes.some(code => typeof code !== 'string' || code.length === 0)) {
throw new Error(`${path}.retryableCodes must contain only non-empty strings`)
}
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':View on GitHub (pinned to b150a551b8)