microsoft/vscode · error · Error
Unable to determine repository information. Please ensure yo
Error message
Unable to determine repository information. Please ensure you are working within a Git repository.
What it means
Error "Unable to determine repository information. Please ensure you are working within a Git repository." thrown in microsoft/vscode.
Source
Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:2295
const title = extractTitle(prompt, problemContext);
const { problemStatement, isTruncated } = truncatePrompt(this.logService, prompt, problemContext);
const repoIds = await getRepoId(this._gitService);
let repoOwner: string;
let repoName: string;
let repoHost: string = 'github.com';
if (selectedRepository && selectedRepository !== DEFAULT_REPOSITORY_ID) {
const [owner, repo] = selectedRepository.split('/');
repoOwner = owner;
repoName = repo;
const matchingRepoId = repoIds?.find(id => id.org === owner && id.repo === repo);
if (matchingRepoId) {
repoHost = matchingRepoId.host;
}
} else {
const repoId = repoIds?.[0];
if (!repoId) {
throw new Error(vscode.l10n.t('Unable to determine repository information. Please ensure you are working within a Git repository.'));
}
repoOwner = repoId.org;
repoName = repoId.repo;
repoHost = repoId.host;
}
// Check if CCA is enabled before creating the task.
const ccaEnabled = await this.checkCCAEnabled(repoOwner, repoName);
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__View on GitHub (pinned to a94b963a32)
When it happens
Trigger: Thrown at extensions/copilot/src/extension/chatSessions/vscode-node/copilotCloudSessionsProvider.ts:2295 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/b160130120240114.
Report an issue: GitHub.