microsoft/vscode · error · Error

Invalid input path: ${path}. Be sure to use an absolute path

Error message

Invalid input path: ${path}. Be sure to use an absolute path.

What it means

Error "Invalid input path: ${path}. Be sure to use an absolute path." thrown in microsoft/vscode.

Source

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

 */
export function patternContainsWorkspaceFolderPath(pattern: string | undefined, workspaceService: IWorkspaceService): boolean {
	if (!pattern) {
		return false;
	}

	for (const folderUri of workspaceService.getWorkspaceFolders()) {
		if (pattern.includes(folderUri.fsPath) || pattern.includes(folderUri.path)) {
			return true;
		}
	}

	return false;
}

export function resolveToolInputPath(path: string, promptPathRepresentationService: IPromptPathRepresentationService): URI {
	const uri = promptPathRepresentationService.resolveFilePath(path);
	if (!uri) {
		throw new Error(`Invalid input path: ${path}. Be sure to use an absolute path.`);
	}

	return uri;
}

export async function isFileOkForTool(accessor: ServicesAccessor, uri: URI, buildPromptContext?: IBuildPromptContext): Promise<boolean> {
	try {
		await assertFileOkForTool(accessor, uri, buildPromptContext);
		return true;
	} catch {
		return false;
	}
}

export interface AssertFileOkForToolOptions {
	readOnly?: boolean;
	workingDirectory?: URI;
}

View on GitHub (pinned to a94b963a32)

When it happens

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