microsoft/vscode · error · Error

User cancelled due to truncation.

Error message

User cancelled due to truncation.

What it means

Error "User cancelled due to truncation." thrown in microsoft/vscode.

Source

Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:2322

		if (ccaEnabled.enabled === false) {
			throw new Error(this.getCCADisabledMessage(ccaEnabled, repoHost));
		}

		if (isTruncated) {
			stream.progress(vscode.l10n.t('Truncating context'));
			const truncationResult = await vscode.window.showWarningMessage(
				vscode.l10n.t('Prompt size exceeded'), { modal: true, detail: vscode.l10n.t('Your prompt will be truncated to fit within cloud agent\'s context window. This may affect the quality of the response.') }, CONTINUE_TRUNCATION);
			const userCancelled = token?.isCancellationRequested || !truncationResult || truncationResult !== CONTINUE_TRUNCATION;
			/* __GDPR__
				"copilot.codingAgent.truncation" : {
					"isCancelled" : { "classification": "SystemMetaData", "purpose": "FeatureInsight" }
				}
			*/
			this.telemetry.sendTelemetryEvent('copilot.codingAgent.truncation', { microsoft: true, github: false }, {
				isCancelled: String(userCancelled),
			});
			if (userCancelled) {
				throw new Error(vscode.l10n.t('User cancelled due to truncation.'));
			}
		}

		let partnerAgentId: number | undefined;
		if (partnerAgentName && partnerAgentName !== DEFAULT_PARTNER_AGENT_ID) {
			const partnerAgentIdNum = Number(partnerAgentName);
			if (isNaN(partnerAgentIdNum)) {
				this.logService.warn(`Invalid partner agent name/id provided: ${partnerAgentName}`);
			} else {
				partnerAgentId = partnerAgentIdNum;
			}
		}

		const result = await this._backend.createSession({
			owner: repoOwner,
			repo: repoName,
			title,
			prompt,

View on GitHub (pinned to a94b963a32)

When it happens

Trigger: Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:2322 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of microsoft/vscode@a94b963a32 (2026-08-12). Data as JSON: /api/errors/594f5da351f1465a. Report an issue: GitHub.