{"record":{"id":"13676b1714b90205","repo":"vercel/ai","slug":"cline-manual-compaction-is-not-supported-by-the-s","errorCode":null,"errorMessage":"cline: manual compaction is not supported by the standalone Cline runtime.","messagePattern":"cline: manual compaction is not supported by the standalone Cline runtime\\.","errorType":"exception","errorClass":"HarnessCapabilityUnsupportedError","httpStatus":null,"severity":"error","filePath":"packages/harness-cline/src/cline-session.ts","lineNumber":872,"sourceCode":"       */\n      return runTurn({\n        text: undefined,\n        ...(continueOpts.model ? { model: continueOpts.model } : {}),\n        skills: continueOpts.skills,\n        tools: continueOpts.tools ?? [],\n        ...(continueOpts.instructions\n          ? { instructions: continueOpts.instructions }\n          : {}),\n        emit: continueOpts.emit,\n        ...(continueOpts.abortSignal\n          ? { abortSignal: continueOpts.abortSignal }\n          : {}),\n        responseFormat: continueOpts.responseFormat,\n      });\n    },\n\n    doCompact: async () => {\n      throw new HarnessCapabilityUnsupportedError({\n        message:\n          'cline: manual compaction is not supported by the standalone Cline runtime.',\n        harnessId: HARNESS_ID,\n      });\n    },\n\n    doDestroy: async () => {\n      if (stopped) return;\n      stopped = true;\n      parkedClineSessions.delete(input.sessionId);\n      settlePendingToolResults('Cline session stopped');\n      settlePendingToolApprovals('Cline session stopped');\n      agent?.abort('Cline session destroyed');\n      await teardown();\n    },\n\n    doStop,\n","sourceCodeStart":854,"sourceCodeEnd":890,"githubUrl":"https://github.com/vercel/ai/blob/69428b1f8b037e4d118fb4853428d5c4e620493c/packages/harness-cline/src/cline-session.ts#L854-L890","documentation":"The Cline session's doCompact implementation unconditionally throws a HarnessCapabilityUnsupportedError: the standalone Cline runtime does not support manually triggered context compaction. Compaction in Cline, if any, is handled internally by the runtime, so the harness advertises the capability as unsupported rather than performing a no-op.","triggerScenarios":"Calling session.compact() (doCompact) on a Cline session created via createCline/createSession, in any state.","commonSituations":"A generic harness abstraction that calls compact() on long-running sessions across harnesses, hitting Cline where the operation does not exist; porting an auto-compaction policy from another harness (e.g. a Claude Code harness) to Cline.","solutions":["Do not call compact() on Cline sessions; remove the call or gate it behind a capability check.","Check HarnessCapabilityUnsupportedError / harness capability metadata before invoking compaction in multi-harness code.","Let Cline manage its own context; if context size is a problem, start a fresh session and carry over only necessary state."],"exampleFix":"// before\nawait session.compact();\n// after\ntry {\n  await session.compact();\n} catch (e) {\n  if (!HarnessCapabilityUnsupportedError.isInstance(e)) throw e;\n  // skip: cline does not support manual compaction\n}","handlingStrategy":"try-catch","validationCode":"const COMPACT_SUPPORTED_HARNESSES = new Set(['claude-code' /*, others */]);\nif (!COMPACT_SUPPORTED_HARNESSES.has('cline')) {\n  // skip compaction entirely; do not call session.compact()\n}","typeGuard":null,"tryCatchPattern":"try {\n  await session.compact();\n} catch (e) {\n  if (HarnessCapabilityUnsupportedError.isInstance(e) && e.message.includes('manual compaction is not supported')) {\n    // treat as no-op for cline\n  } else throw e;\n}","preventionTips":["Maintain a capability matrix per harness id and check it before calling optional operations like compact().","Catch HarnessCapabilityUnsupportedError around all optional capability calls in generic harness code.","For Cline, rely on the runtime's own context management instead of manual compaction."],"tags":["capability","compaction","unsupported","cline"],"backgroundTag":"capability-unsupported","analyzedSha":"69428b1f8b037e4d118fb4853428d5c4e620493c","analyzedAt":"2026-08-30T12:32:21.016Z","schemaVersion":2},"datasetVersion":"2026-08-30T13:17:10.514Z"}