{"record":{"id":"485489e459c1a143","repo":"deepseek-ai/deepseek-harness","slug":"maxparalleltoolcalls-must-be-a-positive-integer","errorCode":null,"errorMessage":"maxParallelToolCalls must be a positive integer","messagePattern":"maxParallelToolCalls must be a positive integer","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/agent-loop/src/index.ts","lineNumber":136,"sourceCode":"      : new Error(`agent \"${id}\" creation aborted`, { cause: signal.reason })\n  }\n  const pending = Promise.resolve().then(operation)\n  try {\n    return await raceAbort(pending, signal, id)\n  } catch (error: unknown) {\n    // oxlint-disable-next-line typescript/no-unnecessary-condition -- the signal can abort while the operation is awaited.\n    if (signal.aborted && releaseAbandoned !== undefined) {\n      void pending.then(releaseAbandoned, () => undefined)\n    }\n    throw error\n  }\n}\n\n/** Resolve the deployment-wide scheduler cap at the owning config boundary. */\nfunction resolveMaxParallelToolCalls(value: number | undefined): number {\n  const maxParallelToolCalls = value ?? DEFAULT_MAX_PARALLEL_TOOL_CALLS\n  if (!Number.isInteger(maxParallelToolCalls) || maxParallelToolCalls < 1) {\n    throw new Error('maxParallelToolCalls must be a positive integer')\n  }\n  return maxParallelToolCalls\n}\n\n/** Reject an output-token cap that cannot be represented exactly on the request wire. */\nfunction assertAgentOptions(options: AgentOptions): void {\n  if (options.maxTokens !== undefined\n    && (!Number.isSafeInteger(options.maxTokens) || options.maxTokens <= 0)) {\n    throw new TypeError('agent maxTokens must be a positive safe integer')\n  }\n}\n\n/** Prepared-but-unpublished agent resources sharing one memoized teardown. */\ninterface PreparedAgent {\n  agent: ReactLoopAgent\n  /** Aborts when the factory unloads, the caller cancels, or teardown begins — ends any setup await. */\n  signal: AbortSignal\n  /** Enter registries, announce, notify session-start, and start the machine. */","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/agent-loop/src/index.ts#L118-L154","documentation":"Error \"maxParallelToolCalls must be a positive integer\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/agent-loop/src/index.ts:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set maxParallelToolCalls to a positive integer."],"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"}