{"record":{"id":"63386246b202400a","repo":"microsoft/vscode","slug":"cloud-agent-is-unable-to-create-pull-requests-in-t","errorCode":null,"errorMessage":"Cloud agent is unable to create pull requests in this repository. Please verify repository rules allow this operation.","messagePattern":"Cloud agent is unable to create pull requests in this repository\\. Please verify repository rules allow this operation\\.","errorType":"exception","errorClass":"Error","httpStatus":422,"severity":"error","filePath":"extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts","lineNumber":2305,"sourceCode":"\t\t\trepoName = repo;\n\t\t\tconst matchingRepoId = repoIds?.find(id => id.org === owner && id.repo === repo);\n\t\t\tif (matchingRepoId) {\n\t\t\t\trepoHost = matchingRepoId.host;\n\t\t\t}\n\t\t} else {\n\t\t\tconst repoId = repoIds?.[0];\n\t\t\tif (!repoId) {\n\t\t\t\tthrow new Error(vscode.l10n.t('Unable to determine repository information. Please ensure you are working within a Git repository.'));\n\t\t\t}\n\t\t\trepoOwner = repoId.org;\n\t\t\trepoName = repoId.repo;\n\t\t\trepoHost = repoId.host;\n\t\t}\n\n\t\t// Check if CCA is enabled before creating the task.\n\t\tconst ccaEnabled = await this.checkCCAEnabled(repoOwner, repoName);\n\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}","sourceCodeStart":2287,"sourceCodeEnd":2323,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts#L2287-L2323","documentation":"Error \"Cloud agent is unable to create pull requests in this repository. Please verify repository rules allow this operation.\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:2305 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"}