deepseek-ai/deepseek-harness · error · TypeError
maxResultChars must be a positive safe integer
Error message
maxResultChars must be a positive safe integer
What it means
Error "maxResultChars must be a positive safe integer" thrown in deepseek-ai/deepseek-harness.
Source
Thrown at packages/workflow/tool-ralph/src/index.ts:202
+ 'belongs to goal tools.'
/** Validate defaults even when a caller invokes apply() without Loader normalization. */
function resolveConfig(config: Config): ResolvedConfig {
const subagentProvider = config.subagentProvider ?? 'spawn'
const maxRounds = config.maxRounds ?? 256
const maxHandoffChars = config.maxHandoffChars ?? 16_384
const maxResultChars = config.maxResultChars ?? 16_384
if (subagentProvider.length === 0 || subagentProvider !== subagentProvider.trim()) {
throw new TypeError('subagentProvider must be a non-empty normalized string')
}
if (!Number.isSafeInteger(maxRounds) || maxRounds < 1) {
throw new TypeError('maxRounds must be a positive safe integer')
}
if (!Number.isSafeInteger(maxHandoffChars) || maxHandoffChars < 1) {
throw new TypeError('maxHandoffChars must be a positive safe integer')
}
if (!Number.isSafeInteger(maxResultChars) || maxResultChars < 1) {
throw new TypeError('maxResultChars must be a positive safe integer')
}
return { subagentProvider, maxRounds, maxHandoffChars, maxResultChars }
}
/** Resolve one model-selected cap against the deployment ceiling. */
function resolveMaxRounds(requested: number | undefined, ceiling: number): number {
const value = requested ?? ceiling
if (!Number.isSafeInteger(value) || value < 1) {
throw new TypeError('Ralph maxRounds must be a positive safe integer')
}
if (value > ceiling) {
throw new TypeError(`Ralph maxRounds ${value} exceeds the deployment ceiling ${ceiling}`)
}
return value
}
/** Require the configured route to mean a genuinely fresh structured child. */
function requireFreshProvider(ctx: Context, name: string): SubagentProvider {View on GitHub (pinned to b150a551b8)
Solutions
- Pass maxResultChars as a positive safe integer in the Ralph tool arguments.
When it happens
Trigger: Thrown at packages/workflow/tool-ralph/src/index.ts:202 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/75f1249afaac9c6e.
Report an issue: GitHub.