{"record":{"id":"6ad658680f630ba1","repo":"deepseek-ai/deepseek-harness","slug":"maxparallelsubcalls-must-be-a-positive-integer","errorCode":null,"errorMessage":"maxParallelSubCalls must be a positive integer","messagePattern":"maxParallelSubCalls must be a positive integer","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/tools/src/index.ts","lineNumber":778,"sourceCode":"}\n\n/** Caller cancellation and dispatch state kept outside the around-wrapper view. */\ninterface ToolCancellationState {\n  readonly callerSignal: AbortSignal\n  bodyInvoked: boolean\n}\n\n/** One dispatch-scoped fused signal plus listener cleanup after the body settles. */\ninterface FusedToolSignal {\n  readonly signal: AbortSignal\n  dispose(): void\n}\n\n/** Resolve the run_code overlap cap at the owning config boundary (direct construction bypasses the Loader schema). */\nfunction resolveMaxParallelSubCalls(value: number | undefined): number {\n  const maxParallelSubCalls = value ?? 10\n  if (!Number.isInteger(maxParallelSubCalls) || maxParallelSubCalls < 1) {\n    throw new Error('maxParallelSubCalls must be a positive integer')\n  }\n  return maxParallelSubCalls\n}\n\n/**\n * Tool registry and execution pipeline. Scoped registrations shadow globals;\n * one visibility resolver feeds presentation, lookup, and dispatch.\n */\nexport class ToolRuntime extends Service {\n  static inject = ['systemPrompt']\n\n  static Config: z<Config> = z.object({\n    mode: z.union(['native', 'code', 'both'] as const).default('native'),\n    maxParallelSubCalls: z.natural().min(1).default(10),\n  })\n\n  /** Internal staged view consumed by `dsh-agent-loop`'s parallel scheduler. */\n  readonly [TOOL_RUNTIME_SCHEDULER]: ToolRuntimeScheduler = {","sourceCodeStart":760,"sourceCodeEnd":796,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/tools/src/index.ts#L760-L796","documentation":"Config validation in resolveMaxParallelSubCalls: the run_code overlap cap is not a positive integer. Values like 0, negatives, NaN, Infinity, or fractional numbers cannot cap concurrent sub-calls and are rejected at the config boundary (direct construction bypasses the Loader schema).","triggerScenarios":"Thrown at packages/core/tools/src/index.ts:778 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set maxParallelSubCalls to a positive integer such as 10 (the default)","Omit the field to use the default","Validate external config input before passing it through"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}