microsoft/vscode · error · Error

Repo base branch is not detected on remote. Push your branch

Error message

Repo base branch is not detected on remote. Push your branch and try again.

What it means

Error "Repo base branch is not detected on remote. Push your branch and try again." thrown in microsoft/vscode.

Source

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

			try {
				stream.progress(vscode.l10n.t('Pushing base branch to remote'));
				const baseBranch = await this.gitOperationsManager.pushBaseRefToRemote();
				stream.markdown(vscode.l10n.t('Base branch `{0}` pushed to remote.', baseBranch));
			} catch (error) {
				this.logService.error(`Push branch failed: ${error}`);
				throw vscode.l10n.t('{0}. Push the current branch to remote and try again.', (error instanceof Error ? error.message : String(error)) ?? vscode.l10n.t('Failed to push current branch.'));
			}
		}

		// Get the selected repository from the chat context for multiroot workspace support
		const chatResource = metadata.chatContext.chatSessionContext?.chatSessionItem?.resource;
		const selectedRepository = chatResource ? this.sessionRepositoryMap.get(chatResource) : undefined;

		const base_ref: string = await (async () => {
			const res = await this.checkBaseBranchPresentOnRemote(selectedRepository);
			if (!res) {
				// Unexpected
				throw new Error(vscode.l10n.t('Repo base branch is not detected on remote. Push your branch and try again.'));
			}
			return (res?.missingOnRemote || !res?.baseRef) ? res.repoDefaultBranch : res?.baseRef;
		})();
		stream.progress(vscode.l10n.t('Validating branch base branch exists on remote'));

		// Now trigger delegation
		try {
			await this.delegate(request, stream, context, token, metadata, base_ref, head_ref);
		} catch (error) {
			this.logService.error(`Failure in delegation: ${error}`);
			throw new Error(vscode.l10n.t('{0}', (error instanceof Error ? error.message : String(error))));
		}
	}

	/**
	 * Handle a click on the chat input "Create pull request" toolbar action (contributed to
	 * `chat/input/editing/sessionToolbar` and registered as
	 * {@link CREATE_PULL_REQUEST_FOR_TASK_COMMAND_ID}). The toolbar passes the session resource

View on GitHub (pinned to a94b963a32)

When it happens

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