deepseek-ai/deepseek-harness · error · Error

ToolResultPruneConfig: unknown key "${key}" (allowed: thresh

Error message

ToolResultPruneConfig: unknown key "${key}" (allowed: thresholdChars, headChars, tailChars)

What it means

Error "ToolResultPruneConfig: unknown key "${key}" (allowed: thresholdChars, headChars, tailChars)" thrown in deepseek-ai/deepseek-harness.

Source

Thrown at packages/compaction/compaction-tool-result-pruner/src/config.ts:39

/**
 * Count Unicode code points without splitting surrogate pairs.
 * @param text - text to measure.
 * @returns the Unicode code-point count.
 */
export function codePointLength(text: string): number {
  return Array.from(text).length
}

/**
 * Resolve and validate pruning budgets.
 * @param config - raw plugin configuration.
 * @returns a detached deeply immutable configuration.
 */
export function resolveConfig(config: ToolResultPruneConfig = {}): ResolvedConfig {
  for (const key of Object.keys(config)) {
    if (!CONFIG_KEYS.has(key)) {
      throw new Error(
        `ToolResultPruneConfig: unknown key "${key}" `
        + '(allowed: thresholdChars, headChars, tailChars)',
      )
    }
  }

  const resolved: ResolvedConfig = {
    thresholdChars: config.thresholdChars ?? DEFAULTS.thresholdChars,
    headChars: config.headChars ?? DEFAULTS.headChars,
    tailChars: config.tailChars ?? DEFAULTS.tailChars,
  }
  assertPositiveInteger('thresholdChars', resolved.thresholdChars)
  assertNonNegativeInteger('headChars', resolved.headChars)
  assertNonNegativeInteger('tailChars', resolved.tailChars)

  const emittedChars = resolved.headChars
    + codePointLength(PRUNE_MARKER)
    + resolved.tailChars

View on GitHub (pinned to b150a551b8)

Solutions

  1. Use only the allowed keys: thresholdChars, headChars, tailChars.

When it happens

Trigger: Thrown at packages/compaction/compaction-tool-result-pruner/src/config.ts:39 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/0fe17d855086cec7. Report an issue: GitHub.