vercel/ai · error · HarnessCapabilityUnsupportedError

cline: manual compaction is not supported by the standalone

Error message

cline: manual compaction is not supported by the standalone Cline runtime.

What it means

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.

Source

Thrown at packages/harness-cline/src/cline-session.ts:872

       */
      return runTurn({
        text: undefined,
        ...(continueOpts.model ? { model: continueOpts.model } : {}),
        skills: continueOpts.skills,
        tools: continueOpts.tools ?? [],
        ...(continueOpts.instructions
          ? { instructions: continueOpts.instructions }
          : {}),
        emit: continueOpts.emit,
        ...(continueOpts.abortSignal
          ? { abortSignal: continueOpts.abortSignal }
          : {}),
        responseFormat: continueOpts.responseFormat,
      });
    },

    doCompact: async () => {
      throw new HarnessCapabilityUnsupportedError({
        message:
          'cline: manual compaction is not supported by the standalone Cline runtime.',
        harnessId: HARNESS_ID,
      });
    },

    doDestroy: async () => {
      if (stopped) return;
      stopped = true;
      parkedClineSessions.delete(input.sessionId);
      settlePendingToolResults('Cline session stopped');
      settlePendingToolApprovals('Cline session stopped');
      agent?.abort('Cline session destroyed');
      await teardown();
    },

    doStop,

View on GitHub (pinned to 69428b1f8b)

Solutions

  1. Do not call compact() on Cline sessions; remove the call or gate it behind a capability check.
  2. Check HarnessCapabilityUnsupportedError / harness capability metadata before invoking compaction in multi-harness code.
  3. Let Cline manage its own context; if context size is a problem, start a fresh session and carry over only necessary state.

Example fix

// before
await session.compact();
// after
try {
  await session.compact();
} catch (e) {
  if (!HarnessCapabilityUnsupportedError.isInstance(e)) throw e;
  // skip: cline does not support manual compaction
}
Defensive patterns

Strategy: try-catch

Validate before calling

const COMPACT_SUPPORTED_HARNESSES = new Set(['claude-code' /*, others */]);
if (!COMPACT_SUPPORTED_HARNESSES.has('cline')) {
  // skip compaction entirely; do not call session.compact()
}

Try / catch

try {
  await session.compact();
} catch (e) {
  if (HarnessCapabilityUnsupportedError.isInstance(e) && e.message.includes('manual compaction is not supported')) {
    // treat as no-op for cline
  } else throw e;
}

Prevention

When it happens

Trigger: Calling session.compact() (doCompact) on a Cline session created via createCline/createSession, in any state.

Common situations: 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.

Related errors


AI-assisted analysis of vercel/ai@69428b1f8b (2026-08-30). Data as JSON: /api/errors/13676b1714b90205. Report an issue: GitHub.