{"record":{"id":"d4804ee1b36092c1","repo":"deepseek-ai/deepseek-harness","slug":"tool-name-parameters-must-be-lossless-json-be","errorCode":null,"errorMessage":"tool \"${name}\" parameters must be lossless JSON before schema projection","messagePattern":"tool \"(.+?)\" parameters must be lossless JSON before schema projection","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/tools/src/index.ts","lineNumber":1260,"sourceCode":"      .map((definition): ToolSdkSchema => {\n        const output = snapshotJsonValue(definition.output.schema)\n        /* v8 ignore next -- registration already validated and retained this schema as lossless JSON. */\n        if (output === undefined) {\n          throw new Error(`tool \"${definition.name}\" output schema must be lossless JSON before SDK projection`)\n        }\n        return {\n          ...this.schemaOf(definition, true),\n          output,\n        }\n      })\n  }\n\n  /** Project one definition onto the model-facing schema fields. */\n  private schemaOf(definition: ToolDefinition, detachParameters: boolean): ToolSchema {\n    const { name, description, parameters } = definition\n    const detached = detachParameters ? snapshotJsonValue(parameters) : parameters\n    if (detached === undefined) {\n      throw new Error(`tool \"${name}\" parameters must be lossless JSON before schema projection`)\n    }\n    return {\n      name,\n      description,\n      parameters: detached,\n    }\n  }\n\n  /**\n   * Classify a pending call through the caller's visible tool definition. Only\n   * an exact `true` is parallel; unknown, hidden, undeclared, invalid, or\n   * throwing classifiers are exclusive.\n   * @param exec - call name, parsed arguments, and optional agent scope.\n   * @returns the fail-closed scheduling mode.\n   */\n  executionMode(exec: ToolExecutionInput): ToolExecutionMode {\n    const tool = this.resolveExecution(exec.name, exec.agent, exec.parent !== undefined)\n    if (!tool?.isConcurrencySafe) return { kind: 'exclusive' }","sourceCodeStart":1242,"sourceCodeEnd":1278,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/core/tools/src/index.ts#L1242-L1278","documentation":"Lossless-JSON checkpoint during model-facing schema projection: a registered tool's parameters value cannot be snapshot as exact JSON. Registration normally guarantees lossless JSON, so this fires only when an arguments getter or mutation swapped the value after registration — the throw names which tool broke the invariant.","triggerScenarios":"Thrown at packages/core/tools/src/index.ts:1260 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Register parameters as plain lossless JSON (no getters, functions, undefined, bigint)","Avoid mutating definition.parameters after registration","Pre-serialize dynamic schemas to plain JSON before registering"],"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"}