{"record":{"id":"e9ba9582e67472e8","repo":"paperclipai/paperclip","slug":"turnstarttimeoutms-must-be-a-positive-safe-integer","errorCode":null,"errorMessage":"turnStartTimeoutMs must be a positive safe integer","messagePattern":"turnStartTimeoutMs must be a positive safe integer","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/live/runnerd-codex-transport.ts","lineNumber":5299,"sourceCode":"        },\n        ...(call.sourceEventId && call.sourceEventType\n          ? {\n              paperclipTrace: {\n                sourceEventId: call.sourceEventId,\n                sourceEventType: call.sourceEventType,\n              },\n            }\n          : {}),\n      }),\n    );\n  }\n\n  async #startTurn(\n    params: Record<string, unknown>,\n  ): Promise<Record<string, unknown>> {\n    const turnStartTimeoutMs = this.options.turnStartTimeoutMs ?? 30_000;\n    if (!Number.isSafeInteger(turnStartTimeoutMs) || turnStartTimeoutMs <= 0) {\n      throw new Error(\"turnStartTimeoutMs must be a positive safe integer\");\n    }\n    const commandDeadline = Date.now() + turnStartTimeoutMs;\n    const input = Array.isArray(params.input) ? params.input.map(record) : [];\n    const message = input\n      .map((item) => (typeof item.text === \"string\" ? item.text : \"\"))\n      .join(\"\\n\");\n    const pendingTurnId = `turn_lab_${randomUUID().replaceAll(\"-\", \"\")}`;\n    this.#turnId = pendingTurnId;\n    const responseEpoch = ++this.#turnStartResponseEpoch;\n    this.#turnStartAdmission?.resolve(false);\n    let resolveAdmission!: (accepted: boolean) => void;\n    this.#turnStartAdmission = {\n      settled: new Promise((resolve) => {\n        resolveAdmission = resolve;\n      }),\n      resolve: (accepted) => resolveAdmission(accepted),\n    };\n    this.#turnStartResponsePending = true;","sourceCodeStart":5281,"sourceCodeEnd":5317,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/live/runnerd-codex-transport.ts#L5281-L5317","documentation":"Options guard in #startTurn of the runnerd Codex transport: the configured turnStartTimeoutMs (default 30000) is not a positive safe integer. This is a configuration error in the transport options object, validated before any turn is started.","triggerScenarios":"Thrown at packages/paperclip-runner/src/live/runnerd-codex-transport.ts:5299 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set turnStartTimeoutMs to a positive integer below Number.MAX_SAFE_INTEGER","Remove the option to use the 30s default","Fix the config source that produced NaN, zero, negative, or fractional values"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}