{"record":{"id":"496c3104623313e2","repo":"earendil-works/pi","slug":"refusing-to-use-path-outside-package-install-root","errorCode":null,"errorMessage":"Refusing to use path outside package install root: ${resolvedPath}","messagePattern":"Refusing to use path outside package install root: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/core/package-manager.ts","lineNumber":2129,"sourceCode":"\t\t\treturn join(this.cwd, CONFIG_DIR_NAME, \"git\");\n\t\t}\n\t\treturn join(this.agentDir, \"git\");\n\t}\n\n\tprivate getTemporaryDir(prefix: string, suffix?: string): string {\n\t\tconst root = this.resolveManagedPath(getExtensionTempFolder(this.agentDir), prefix);\n\t\tconst hash = createHash(\"sha256\")\n\t\t\t.update(`${prefix}-${suffix ?? \"\"}`)\n\t\t\t.digest(\"hex\")\n\t\t\t.slice(0, 8);\n\t\treturn this.resolveManagedPath(root, hash, suffix ?? \"\");\n\t}\n\n\tprivate resolveManagedPath(root: string, ...parts: string[]): string {\n\t\tconst resolvedRoot = resolve(root);\n\t\tconst resolvedPath = resolve(resolvedRoot, ...parts);\n\t\tif (resolvedPath !== resolvedRoot && !resolvedPath.startsWith(`${resolvedRoot}${sep}`)) {\n\t\t\tthrow new Error(`Refusing to use path outside package install root: ${resolvedPath}`);\n\t\t}\n\t\treturn resolvedPath;\n\t}\n\n\tprivate getBaseDirForScope(scope: SourceScope): string {\n\t\tif (scope === \"project\") {\n\t\t\tthis.assertProjectTrustedForScope(scope);\n\t\t\treturn join(this.cwd, CONFIG_DIR_NAME);\n\t\t}\n\t\tif (scope === \"user\") {\n\t\t\treturn this.agentDir;\n\t\t}\n\t\treturn this.cwd;\n\t}\n\n\tprivate resolvePath(input: string): string {\n\t\treturn resolvePath(input, this.cwd, { homeDir: getHomeDir(), trim: true });\n\t}","sourceCodeStart":2111,"sourceCodeEnd":2147,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/coding-agent/src/core/package-manager.ts#L2111-L2147","documentation":"Error \"Refusing to use path outside package install root: ${resolvedPath}\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/coding-agent/src/core/package-manager.ts:2129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}