{"record":{"id":"594f5da351f1465a","repo":"microsoft/vscode","slug":"user-cancelled-due-to-truncation","errorCode":null,"errorMessage":"User cancelled due to truncation.","messagePattern":"User cancelled due to truncation\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts","lineNumber":2322,"sourceCode":"\t\tif (ccaEnabled.enabled === false) {\n\t\t\tthrow new Error(this.getCCADisabledMessage(ccaEnabled, repoHost));\n\t\t}\n\n\t\tif (isTruncated) {\n\t\t\tstream.progress(vscode.l10n.t('Truncating context'));\n\t\t\tconst truncationResult = await vscode.window.showWarningMessage(\n\t\t\t\tvscode.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);\n\t\t\tconst userCancelled = token?.isCancellationRequested || !truncationResult || truncationResult !== CONTINUE_TRUNCATION;\n\t\t\t/* __GDPR__\n\t\t\t\t\"copilot.codingAgent.truncation\" : {\n\t\t\t\t\t\"isCancelled\" : { \"classification\": \"SystemMetaData\", \"purpose\": \"FeatureInsight\" }\n\t\t\t\t}\n\t\t\t*/\n\t\t\tthis.telemetry.sendTelemetryEvent('copilot.codingAgent.truncation', { microsoft: true, github: false }, {\n\t\t\t\tisCancelled: String(userCancelled),\n\t\t\t});\n\t\t\tif (userCancelled) {\n\t\t\t\tthrow new Error(vscode.l10n.t('User cancelled due to truncation.'));\n\t\t\t}\n\t\t}\n\n\t\tlet partnerAgentId: number | undefined;\n\t\tif (partnerAgentName && partnerAgentName !== DEFAULT_PARTNER_AGENT_ID) {\n\t\t\tconst partnerAgentIdNum = Number(partnerAgentName);\n\t\t\tif (isNaN(partnerAgentIdNum)) {\n\t\t\t\tthis.logService.warn(`Invalid partner agent name/id provided: ${partnerAgentName}`);\n\t\t\t} else {\n\t\t\t\tpartnerAgentId = partnerAgentIdNum;\n\t\t\t}\n\t\t}\n\n\t\tconst result = await this._backend.createSession({\n\t\t\towner: repoOwner,\n\t\t\trepo: repoName,\n\t\t\ttitle,\n\t\t\tprompt,","sourceCodeStart":2304,"sourceCodeEnd":2340,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts#L2304-L2340","documentation":"Error \"User cancelled due to truncation.\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:2322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}