microsoft/vscode · error · Error

File ${promptPathRepresentationService.getFilePath(normalize

Error message

File ${promptPathRepresentationService.getFilePath(normalizedUri)} is outside of the workspace, and not open in an editor, and can't be read

What it means

Error "File ${promptPathRepresentationService.getFilePath(normalizedUri)} is outside of the workspace, and not open in an editor, and can't be read" thrown in microsoft/vscode.

Source

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

	if (fileOpenInSomeTab) {
		return;
	}
	if (diskSessionResources.isSessionResourceUri(normalizedUri)) {
		return;
	}
	if (chatDebugFileLogger.isDebugLogUri(normalizedUri)) {
		return;
	}
	if (sessionTranscriptService.isTranscriptUri(normalizedUri)) {
		return;
	}
	if (normalizedUri.scheme === 'vscode-chat-response-resource') {
		return;
	}
	if (await isExternalInstructionsFile(normalizedUri, customInstructionsService, buildPromptContext)) {
		return;
	}
	throw new Error(`File ${promptPathRepresentationService.getFilePath(normalizedUri)} is outside of the workspace, and not open in an editor, and can't be read`);
}

async function isExternalInstructionsFile(normalizedUri: URI, customInstructionsService: ICustomInstructionsService, buildPromptContext?: IBuildPromptContext): Promise<boolean> {
	if (buildPromptContext) {
		const instructionIndexFile = getInstructionsIndexFile(buildPromptContext, customInstructionsService);
		if (instructionIndexFile) {
			if (instructionIndexFile.instructions.has(normalizedUri) || instructionIndexFile.skills.has(normalizedUri)) {
				return true;
			}
			// Check if the URI is under any skill folder (e.g., nested files like primitives/agents.md)
			for (const skillFolderUri of instructionIndexFile.skillFolders) {
				if (extUriBiasedIgnorePathCase.isEqualOrParent(normalizedUri, skillFolderUri)) {
					return true;
				}
			}
		}
		const attachedPromptFile = buildPromptContext.chatVariables.find(v => isPromptFile(v.reference) && isEqual(normalizedUri, v.reference.value));
		if (attachedPromptFile) {

View on GitHub (pinned to a94b963a32)

When it happens

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