microsoft/vscode · error · Error

Unable to load the task to create a pull request.

Error message

Unable to load the task to create a pull request.

What it means

Error "Unable to load the task to create a pull request." thrown in microsoft/vscode.

Source

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

		// Re-entrancy guard: ignore repeat invocations while a create-PR request for this task is
		// still in flight (e.g. the toolbar action triggered again before the first call settled)
		// so we don't submit duplicate PRs. Hide the toolbar action immediately; it is restored on
		// failure below, and on success it is replaced by the "Open pull request" action.
		if (this._createPullRequestInFlightTaskIds.has(taskId)) {
			return;
		}
		this._createPullRequestInFlightTaskIds.add(taskId);
		this.setCanCreatePullRequestContext(false);

		try {
			await vscode.window.withProgress(
				{ location: vscode.ProgressLocation.Notification, title: vscode.l10n.t('Creating pull request') },
				async () => {
					// The backend creates the PR for the full task, resolving `{owner, repo}` itself
					// (from the task's `html_url`, falling back to a GitHub lookup by `repository.id`).
					const taskContent = await backend.fetchTaskContent(taskId);
					if (!taskContent) {
						throw new Error(vscode.l10n.t('Unable to load the task to create a pull request.'));
					}
					const result = await backend.createPullRequestForTask(taskContent.task);
					/* __GDPR__
						"copilotcloud.chat.createPRFromTask" : {
							"owner": "osortega",
							"comment": "Event sent when the user invokes the 'Create pull request' toolbar action on a settled cloud task without a pull request.",
							"outcome": { "classification": "SystemMetaData", "purpose": "FeatureInsight", "comment": "Whether the create-pull-request call succeeded or failed." }
						}
					*/
					this.telemetry.sendMSFTTelemetryEvent('copilotcloud.chat.createPRFromTask', {
						outcome: !!result ? 'success' : 'failure'
					});
					// Wait until the new PR is reflected on the task as a `pull` artifact so the gate
					// update below sees `hasPullRequest` and flips to the "Open pull request" action.
					await this._waitForTaskPullRequestReflected(backend, taskId);
				},
			);
		} catch (error) {

View on GitHub (pinned to a94b963a32)

When it happens

Trigger: Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:1696 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/e1ea9dc2e34584a6. Report an issue: GitHub.