{"record":{"id":"44d3e067033bef24","repo":"deepseek-ai/deepseek-harness","slug":"toolresultpruneconfig-headchars-marker-tailch","errorCode":null,"errorMessage":"ToolResultPruneConfig: headChars + marker + tailChars (${emittedChars}) must be at most thresholdChars (${resolved.thresholdChars})","messagePattern":"ToolResultPruneConfig: headChars \\+ marker \\+ tailChars \\((.+?)\\) must be at most thresholdChars \\((.+?)\\)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/compaction/compaction-tool-result-pruner/src/config.ts","lineNumber":59,"sourceCode":"        + '(allowed: thresholdChars, headChars, tailChars)',\n      )\n    }\n  }\n\n  const resolved: ResolvedConfig = {\n    thresholdChars: config.thresholdChars ?? DEFAULTS.thresholdChars,\n    headChars: config.headChars ?? DEFAULTS.headChars,\n    tailChars: config.tailChars ?? DEFAULTS.tailChars,\n  }\n  assertPositiveInteger('thresholdChars', resolved.thresholdChars)\n  assertNonNegativeInteger('headChars', resolved.headChars)\n  assertNonNegativeInteger('tailChars', resolved.tailChars)\n\n  const emittedChars = resolved.headChars\n    + codePointLength(PRUNE_MARKER)\n    + resolved.tailChars\n  if (emittedChars > resolved.thresholdChars) {\n    throw new Error(\n      `ToolResultPruneConfig: headChars + marker + tailChars (${emittedChars}) `\n      + `must be at most thresholdChars (${resolved.thresholdChars})`,\n    )\n  }\n  return deepFreeze(structuredClone(resolved))\n}\n\nfunction assertPositiveInteger(name: string, value: number): void {\n  if (!Number.isInteger(value) || value <= 0) {\n    throw new Error(`ToolResultPruneConfig: ${name} (${value}) must be a positive integer`)\n  }\n}\n\nfunction assertNonNegativeInteger(name: string, value: number): void {\n  if (!Number.isInteger(value) || value < 0) {\n    throw new Error(`ToolResultPruneConfig: ${name} (${value}) must be a non-negative integer`)\n  }\n}","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/compaction/compaction-tool-result-pruner/src/config.ts#L41-L77","documentation":"Error \"ToolResultPruneConfig: headChars + marker + tailChars (${emittedChars}) must be at most thresholdChars (${resolved.thresholdChars})\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/compaction/compaction-tool-result-pruner/src/config.ts:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Raise thresholdChars or lower headChars and tailChars so they fit with the marker."],"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"}