{"record":{"id":"8f479235534534d4","repo":"deepseek-ai/deepseek-harness","slug":"settings-verb-for-ns-must-contain-only-jso","errorCode":null,"errorMessage":"settings ${verb} for \"${ns}\" must contain only JSON-compatible data (found a non-finite number at ${path})","messagePattern":"settings (.+?) for \"(.+?)\" must contain only JSON-compatible data \\(found a non-finite number at (.+?)\\)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/settings/settings/src/index.ts","lineNumber":261,"sourceCode":" * only JSON data (plain objects, arrays, strings, finite numbers,\n * booleans, `null`) may reach a provider document. `structuredClone` alone\n * would admit Dates, Maps, BigInts, and cycles that YAML/JSON storage then\n * silently distorts on the reload round-trip. `undefined` entries in objects\n * are skipped — the same sparse-patch semantics as {@link mergeLayers} — while\n * an `undefined` array entry is rejected rather than coerced.\n * @param root - plain-object write input (caller-checked).\n * @param reject - builds the validation error from a value label and its `$`-rooted path.\n * @returns the detached JSON-compatible clone.\n */\nfunction cloneJsonShaped(\n  root: Record<string, unknown>,\n  reject: (label: string, path: string) => TypeError,\n): Record<string, unknown> {\n  const visiting = new WeakSet<object>()\n  const clone = (value: unknown, path: string): unknown => {\n    if (value === null || typeof value === 'string' || typeof value === 'boolean') return value\n    if (typeof value === 'number') {\n      if (!Number.isFinite(value)) throw reject('a non-finite number', path)\n      return value\n    }\n    if (Array.isArray(value)) {\n      if (visiting.has(value)) throw reject('a circular reference', path)\n      visiting.add(value)\n      const entries = value.map((entry, index) => clone(entry, `${path}[${index}]`))\n      // Un-mark on exit so one object referenced twice without a cycle passes.\n      visiting.delete(value)\n      return entries\n    }\n    if (isPlainObject(value)) {\n      if (visiting.has(value)) throw reject('a circular reference', path)\n      visiting.add(value)\n      // TODO(settings-json-properties): Use property-safe construction here and\n      // in mergeLayers so valid JSON keys such as \"__proto__\" remain own data.\n      const out: Record<string, unknown> = {}\n      for (const [key, entry] of Object.entries(value)) {\n        if (entry === undefined) continue","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/settings/settings/src/index.ts#L243-L279","documentation":"Error \"settings ${verb} for \"${ns}\" must contain only JSON-compatible data (found a non-finite number at ${path})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/settings/settings/src/index.ts:261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace NaN or Infinity with finite numbers or null before writing settings."],"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"}