microsoft/vscode · error · Error

File ${normalizedUri.fsPath} does not exist

Error message

File ${normalizedUri.fsPath} does not exist

What it means

Error "File ${normalizedUri.fsPath} does not exist" thrown in microsoft/vscode.

Source

Thrown at extensions/copilot/src/extension/tools/node/toolUtils.ts:326

	}
	if (diskSessionResources.isSessionResourceUri(normalizedUri)) {
		return false;
	}
	if (chatDebugFileLogger.isDebugLogUri(normalizedUri)) {
		return false;
	}
	if (sessionTranscriptService.isTranscriptUri(normalizedUri)) {
		return false;
	}
	if (tabsAndEditorsService.tabs.some(tab => isEqual(tab.uri, uri))) {
		return false;
	}

	// If the file doesn't exist, throw immediately rather than showing a confusing "external file"
	// confirmation — the tool should fail with a clear "file not found" error instead.
	const fileExists = await fileSystemService.stat(normalizedUri).then(() => true).catch(() => false);
	if (!fileExists) {
		throw new Error(`File ${normalizedUri.fsPath} does not exist`);
	}

	return true;
}

export function isDirExternalAndNeedsConfirmation(accessor: ServicesAccessor, uri: URI, buildPromptContext?: IBuildPromptContext, options?: { readOnly?: boolean; workingDirectory?: URI }): boolean {
	const workspaceService = accessor.get(IWorkspaceService);
	const customInstructionsService = accessor.get(ICustomInstructionsService);
	const configurationService = accessor.get(IConfigurationService);

	const normalizedUri = normalizePath(uri);

	const workingDir = new WorkingDirectory(options?.workingDirectory, workspaceService);
	if (workingDir.getFolder(normalizedUri)) {
		return false;
	}
	if (options?.readOnly && isUriUnderAdditionalReadAccessPaths(normalizedUri, configurationService)) {
		return false;

View on GitHub (pinned to a94b963a32)

When it happens

Trigger: Thrown at extensions/copilot/src/extension/tools/node/toolUtils.ts:326 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/1aefb32e81a3701c. Report an issue: GitHub.