{"record":{"id":"f9bb7639c26dee41","repo":"microsoft/vscode","slug":"file-promptpathrepresentationservice-getfilepath","errorCode":null,"errorMessage":"File ${promptPathRepresentationService.getFilePath(normalizedUri)} is outside of the workspace, and not open in an editor, and can't be read","messagePattern":"File (.+?) is outside of the workspace, and not open in an editor, and can't be read","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/tools/node/toolUtils.ts","lineNumber":220,"sourceCode":"\tif (fileOpenInSomeTab) {\n\t\treturn;\n\t}\n\tif (diskSessionResources.isSessionResourceUri(normalizedUri)) {\n\t\treturn;\n\t}\n\tif (chatDebugFileLogger.isDebugLogUri(normalizedUri)) {\n\t\treturn;\n\t}\n\tif (sessionTranscriptService.isTranscriptUri(normalizedUri)) {\n\t\treturn;\n\t}\n\tif (normalizedUri.scheme === 'vscode-chat-response-resource') {\n\t\treturn;\n\t}\n\tif (await isExternalInstructionsFile(normalizedUri, customInstructionsService, buildPromptContext)) {\n\t\treturn;\n\t}\n\tthrow new Error(`File ${promptPathRepresentationService.getFilePath(normalizedUri)} is outside of the workspace, and not open in an editor, and can't be read`);\n}\n\nasync function isExternalInstructionsFile(normalizedUri: URI, customInstructionsService: ICustomInstructionsService, buildPromptContext?: IBuildPromptContext): Promise<boolean> {\n\tif (buildPromptContext) {\n\t\tconst instructionIndexFile = getInstructionsIndexFile(buildPromptContext, customInstructionsService);\n\t\tif (instructionIndexFile) {\n\t\t\tif (instructionIndexFile.instructions.has(normalizedUri) || instructionIndexFile.skills.has(normalizedUri)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\t// Check if the URI is under any skill folder (e.g., nested files like primitives/agents.md)\n\t\t\tfor (const skillFolderUri of instructionIndexFile.skillFolders) {\n\t\t\t\tif (extUriBiasedIgnorePathCase.isEqualOrParent(normalizedUri, skillFolderUri)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tconst attachedPromptFile = buildPromptContext.chatVariables.find(v => isPromptFile(v.reference) && isEqual(normalizedUri, v.reference.value));\n\t\tif (attachedPromptFile) {","sourceCodeStart":202,"sourceCodeEnd":238,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/tools/node/toolUtils.ts#L202-L238","documentation":"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.","triggerScenarios":"Thrown at extensions/copilot/src/extension/tools/node/toolUtils.ts:220 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}