{"record":{"id":"a4d32a5839cd5cbe","repo":"deepseek-ai/deepseek-harness","slug":"compaction-basic-no-context-capacity-for-target","errorCode":null,"errorMessage":"compaction-basic: no context capacity for ${targetKey}; configure contextWindow on that adapter model","messagePattern":"compaction-basic: no context capacity for (.+?); configure contextWindow on that adapter model","errorType":"validation","errorClass":"TargetPressureConfigError","httpStatus":null,"severity":"error","filePath":"packages/compaction/compaction-basic/src/index.ts","lineNumber":297,"sourceCode":"    // Overflow always qualifies; pressure first resolves the routed model's\n    // capacity and checks its target-specific threshold.\n    const prune = this.ctx.get('toolResultPruner')\n\n    if (trigger === 'context-overflow') {\n      if (prune !== undefined) {\n        prune.pruneSession(agent.session)\n        measurement = meter.measure(agent.session)\n      }\n      const range = selectCompactableRange(agent.session, measurement, 0)\n      if (range === null) return null\n      return this.compactRegion(range.start, range.end, agent, signal)\n    }\n\n    const context = (await this.ctx.llm.resolveModelInfo(target.provider, target.model, signal)).context\n    assertNoActiveCompaction(agent.session, 'automatic pressure compaction')\n    const targetKey = `${target.provider}/${target.model}`\n    if (context === undefined) {\n      throw new TargetPressureConfigError(\n        targetKey,\n        `compaction-basic: no context capacity for ${targetKey}; `\n        + 'configure contextWindow on that adapter model',\n      )\n    }\n    const spec = resolveCompactSpec(policy, context.contextWindow)\n    if (measurement.totalTokens < spec.thresholdTokens) return null\n\n    // Once pressure qualifies, land the model-free pass before choosing a\n    // summary range, then remeasure through the singleton replay fold.\n    if (prune !== undefined) {\n      prune.pruneSession(agent.session)\n      measurement = meter.measure(agent.session)\n    }\n    if (measurement.totalTokens < spec.thresholdTokens) return null\n\n    let result: CompactionResult | null = null\n    for (let attempt = 0; attempt <= spec.compactionRetries; attempt += 1) {","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/compaction/compaction-basic/src/index.ts#L279-L315","documentation":"Error \"compaction-basic: no context capacity for ${targetKey}; configure contextWindow on that adapter model\" thrown in deepseek-ai/deepseek-harness.","triggerScenarios":"Thrown at packages/compaction/compaction-basic/src/index.ts:297 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure contextWindow on the adapter model for that target."],"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"}