deepseek-ai/deepseek-harness · error · Error
tool " " parameters must be lossless JSON before schema…
Error message
tool "${name}" parameters must be lossless JSON before schema projection What it means
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.
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/core/tools/src/index.ts:1260 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24).
Data as JSON: /api/errors/d4804ee1b36092c1.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core/tools/src/index.ts:1260
.map((definition): ToolSdkSchema => {
const output = snapshotJsonValue(definition.output.schema)
/* v8 ignore next -- registration already validated and retained this schema as lossless JSON. */
if (output === undefined) {
throw new Error(`tool "${definition.name}" output schema must be lossless JSON before SDK projection`)
}
return {
...this.schemaOf(definition, true),
output,
}
})
}
/** Project one definition onto the model-facing schema fields. */
private schemaOf(definition: ToolDefinition, detachParameters: boolean): ToolSchema {
const { name, description, parameters } = definition
const detached = detachParameters ? snapshotJsonValue(parameters) : parameters
if (detached === undefined) {
throw new Error(`tool "${name}" parameters must be lossless JSON before schema projection`)
}
return {
name,
description,
parameters: detached,
}
}
/**
* Classify a pending call through the caller's visible tool definition. Only
* an exact `true` is parallel; unknown, hidden, undeclared, invalid, or
* throwing classifiers are exclusive.
* @param exec - call name, parsed arguments, and optional agent scope.
* @returns the fail-closed scheduling mode.
*/
executionMode(exec: ToolExecutionInput): ToolExecutionMode {
const tool = this.resolveExecution(exec.name, exec.agent, exec.parent !== undefined)
if (!tool?.isConcurrencySafe) return { kind: 'exclusive' }View on GitHub (pinned to b150a551b8)