deepseek-ai/deepseek-harness · error

BasicCompactionConfig: auto must be a boolean

Error message

BasicCompactionConfig: auto must be a boolean

What it means

compaction-basic's resolveConfig, run at plugin load, validates the top-level BasicCompactionConfig. When `auto` is present it must be a real boolean — it switches automatic compaction at request pressure; YAML truthiness and numeric flags are not accepted.

Source

Thrown at packages/compaction/compaction-basic/src/config.ts:71

  /**
   * @param targetKey - exact provider/model route used as the warning key.
   * @param message - actionable configuration failure detail.
   */
  constructor(readonly targetKey: string, message: string) {
    super(message)
  }
}

/**
 * Resolve and validate service defaults plus exact-target partial overrides.
 * @param config - untrusted plugin configuration after Loader normalization.
 * @returns detached immutable defaults and validated exact-target overrides.
 */
export function resolveConfig(config: BasicCompactionConfig = {}): ResolvedConfig {
  validateKeys(config, BASIC_COMPACT_CONFIG_KEYS, 'BasicCompactionConfig')
  validatePolicy(config, 'BasicCompactionConfig')
  if (config.auto !== undefined && typeof config.auto !== 'boolean') {
    throw new Error('BasicCompactionConfig: auto must be a boolean')
  }

  const thresholdRatio = config.thresholdRatio ?? DEFAULT_THRESHOLD_RATIO
  const retention = resolveRetention(config, { retainRatio: DEFAULT_RETAIN_RATIO })
  validateRatioRetention(thresholdRatio, retention, 'BasicCompactionConfig')
  const modelPolicies = resolveModelPolicies(config.modelPolicies)
  for (const [index, policy] of modelPolicies.entries()) {
    validateRatioRetention(
      policy.thresholdRatio ?? thresholdRatio,
      resolveRetention(policy, retention),
      `BasicCompactionConfig: modelPolicies[${index}]`,
    )
  }

  return deepFreeze({
    thresholdRatio,
    ...retention,
    summarizationProvider: config.summarizationProvider ?? '',

View on GitHub (pinned to b150a551b8)

Solutions

  1. Write a bare YAML boolean: auto: false (or auto: true).
  2. Omit the key to keep the default (auto defaults to true).
  3. If config is generated, fix the generator to emit real booleans, not strings or numbers.

Example fix

# before — quoted string, rejected at load
auto: "false"

# after — bare boolean
auto: false
Defensive patterns

Strategy: validation

Validate before calling

if (config.auto !== undefined && typeof config.auto !== 'boolean') {
  throw new Error('auto must be a real boolean before cordis.yml is loaded')
}

Type guard

const isBooleanOrAbsent = (v: unknown): boolean =>
  v === undefined || typeof v === 'boolean'

Prevention

When it happens

Trigger: cordis.yml contains auto as a quoted string (auto: "false"), a number (auto: 0 or 1), or any non-boolean produced by templated config generation.

Common situations: YAML quoting mistakes; config generators emitting 0/1 flags; environment-variable interpolation that always yields strings.

Understand the failure class

Background: Config validation failed: what "invalid value for {key}" and settings-rejection errors mean across 19 open-source libraries — this error's family across 19 libraries.

Related errors


AI-assisted analysis of deepseek-ai/deepseek-harness@b150a551b8 (2026-08-24). Data as JSON: /api/errors/d974558b52166ffc. Report an issue: GitHub.