{"record":{"id":"1f4fa2fa85ecc2b3","repo":"deepseek-ai/deepseek-harness","slug":"tool-name-timeoutms-must-be-a-positive-finite","errorCode":null,"errorMessage":"tool \"${name}\" timeoutMs must be a positive finite number","messagePattern":"tool \"(.+?)\" timeoutMs must be a positive finite number","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/core/tools/src/index.ts","lineNumber":1049,"sourceCode":"  /**\n   * Register globally or in the calling agent scope. Scoped tools shadow\n   * globals; duplicates within one layer and the reserved `run_code` name fail.\n   * @param definition - tool schema, execution, and optional finalization/presentation callbacks.\n   * @returns the exact disposer that unregisters the tool.\n   */\n  register(definition: ToolDefinition): () => void {\n    const name = definition.name\n    const output = (definition as Partial<ToolDefinition>).output\n    if (output === undefined || typeof output !== 'object'\n      || typeof output.render !== 'function'\n      || (output.presentationMeta !== undefined && typeof output.presentationMeta !== 'function')) {\n      throw new TypeError(`tool \"${name}\" must declare output { schema, render, presentationMeta? }`)\n    }\n    assertSupportedJsonSchema(output.schema)\n    const timeoutMs = definition.timeoutMs\n    if (timeoutMs !== undefined\n      && (!Number.isFinite(timeoutMs) || timeoutMs <= 0)) {\n      throw new TypeError(`tool \"${name}\" timeoutMs must be a positive finite number`)\n    }\n    // Reserved unconditionally: any agent may select a code mode for itself,\n    // so a name free to take under the deployment default would become a\n    // collision the moment a preset mounted.\n    if (name === RUN_CODE_NAME) {\n      throw new Error(`tool name \"${RUN_CODE_NAME}\" is reserved for the Code Mode presentation transport and cannot be registered or shadowed`)\n    }\n    return this.layers.effect(\n      this.ctx,\n      layer => layer.tools.insert(name, definition),\n      { label: 'tools.register()' },\n    )\n  }\n\n  /**\n   * Restrict global tools for the calling agent scope. Empty filters, unknown\n   * names, scope-local names, and reserved transport names fail. Restrictions\n   * intersect; scoped registrations remain visible.","sourceCodeStart":1031,"sourceCodeEnd":1067,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/tools/src/index.ts#L1031-L1067","documentation":"Error \"tool \"${name}\" timeoutMs must be a positive finite number\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/core/tools/src/index.ts:1049 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"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"}