{"record":{"id":"75f1249afaac9c6e","repo":"deepseek-ai/deepseek-harness","slug":"maxresultchars-must-be-a-positive-safe-integer","errorCode":null,"errorMessage":"maxResultChars must be a positive safe integer","messagePattern":"maxResultChars must be a positive safe integer","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/workflow/tool-ralph/src/index.ts","lineNumber":202,"sourceCode":"  + 'belongs to goal tools.'\n\n/** Validate defaults even when a caller invokes apply() without Loader normalization. */\nfunction resolveConfig(config: Config): ResolvedConfig {\n  const subagentProvider = config.subagentProvider ?? 'spawn'\n  const maxRounds = config.maxRounds ?? 256\n  const maxHandoffChars = config.maxHandoffChars ?? 16_384\n  const maxResultChars = config.maxResultChars ?? 16_384\n  if (subagentProvider.length === 0 || subagentProvider !== subagentProvider.trim()) {\n    throw new TypeError('subagentProvider must be a non-empty normalized string')\n  }\n  if (!Number.isSafeInteger(maxRounds) || maxRounds < 1) {\n    throw new TypeError('maxRounds must be a positive safe integer')\n  }\n  if (!Number.isSafeInteger(maxHandoffChars) || maxHandoffChars < 1) {\n    throw new TypeError('maxHandoffChars must be a positive safe integer')\n  }\n  if (!Number.isSafeInteger(maxResultChars) || maxResultChars < 1) {\n    throw new TypeError('maxResultChars must be a positive safe integer')\n  }\n  return { subagentProvider, maxRounds, maxHandoffChars, maxResultChars }\n}\n\n/** Resolve one model-selected cap against the deployment ceiling. */\nfunction resolveMaxRounds(requested: number | undefined, ceiling: number): number {\n  const value = requested ?? ceiling\n  if (!Number.isSafeInteger(value) || value < 1) {\n    throw new TypeError('Ralph maxRounds must be a positive safe integer')\n  }\n  if (value > ceiling) {\n    throw new TypeError(`Ralph maxRounds ${value} exceeds the deployment ceiling ${ceiling}`)\n  }\n  return value\n}\n\n/** Require the configured route to mean a genuinely fresh structured child. */\nfunction requireFreshProvider(ctx: Context, name: string): SubagentProvider {","sourceCodeStart":184,"sourceCodeEnd":220,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/workflow/tool-ralph/src/index.ts#L184-L220","documentation":"Error \"maxResultChars must be a positive safe integer\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/workflow/tool-ralph/src/index.ts:202 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass maxResultChars as a positive safe integer in the Ralph tool arguments."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}