{"record":{"id":"50e97c24bbd8e4ca","repo":"Fission-AI/OpenSpec","slug":"warning-could-not-clean-profilepath-error","errorCode":null,"errorMessage":"Warning: Could not clean ${profilePath}: ${error}","messagePattern":"Warning: Could not clean (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/completions/installers/powershell-installer.ts","lineNumber":312,"sourceCode":"        if (endIndex === -1) {\n          console.warn(`Warning: Found start marker but no end marker in ${profilePath}`);\n          continue;\n        }\n\n        // Remove the block (including markers and surrounding newlines)\n        const beforeBlock = profileContent.substring(0, startIndex);\n        const afterBlock = profileContent.substring(endIndex + endMarker.length);\n\n        // Clean up extra newlines\n        const newContent = (beforeBlock.trimEnd() + '\\n' + afterBlock.trimStart()).trim() + '\\n';\n\n        if (!(await FileSystemUtils.canWriteFile(profilePath))) {\n          throw new Error(`Path is not writable: ${profilePath}`);\n        }\n        await this.writeProfileFile(profilePath, newContent, fileEncoding, fileBom);\n        anyRemoved = true;\n      } catch (error) {\n        console.warn(`Warning: Could not clean ${profilePath}: ${error}`);\n      }\n    }\n\n    return anyRemoved;\n  }\n\n  /**\n   * Install the completion script\n   *\n   * @param completionScript - The completion script content to install\n   * @returns Installation result with status and instructions\n   */\n  async install(completionScript: string): Promise<InstallationResult> {\n    try {\n      const targetPath = this.getInstallationPath();\n\n      // Check if already installed with same content\n      let isUpdate = false;","sourceCodeStart":294,"sourceCodeEnd":330,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/completions/installers/powershell-installer.ts#L294-L330","documentation":"Error \"Warning: Could not clean ${profilePath}: ${error}\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/completions/installers/powershell-installer.ts:312 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":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}