{"record":{"id":"5fee7112630fafd8","repo":"stablyai/orca","slug":"refusing-to-remove-non-orca-command-at-status-co-5fee71","errorCode":null,"errorMessage":"Refusing to remove non-Orca command at ${status.commandPath}.","messagePattern":"Refusing to remove non-Orca command at (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"src/main/cli/wsl-cli-installer.ts","lineNumber":292,"sourceCode":"  async remove(): Promise<CliInstallStatus> {\n    const status = await this.getStatus()\n    if (!status.supported || !status.commandPath) {\n      return status\n    }\n    const legacyCommandPath = `${getPosixDirname(status.commandPath)}/${LEGACY_WSL_COMMAND_NAME}`\n    if (status.state === 'not_installed') {\n      // Why: a managed legacy `orca` left behind would later be re-adopted by\n      // startup reconciliation as opt-in proof, silently undoing this removal.\n      await this.run(\n        this.distro as string,\n        ['set -euo pipefail', buildManagedLegacyRemoveCommand(quoteShell(legacyCommandPath))].join(\n          '\\n'\n        )\n      )\n      return status\n    }\n    if (status.state === 'conflict') {\n      throw new Error(`Refusing to remove non-Orca command at ${status.commandPath}.`)\n    }\n\n    await this.run(\n      this.distro as string,\n      buildSafeRemoveCommand(status.commandPath, legacyCommandPath)\n    )\n    return this.getStatus()\n  }\n\n  private async resolveReadyState(): Promise<\n    | { status: CliInstallStatus }\n    | {\n        distro: string\n        commandPath: string\n        bridgePath: string\n        launcherPath: string\n        pathConfigured: boolean\n      }","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/cli/wsl-cli-installer.ts#L274-L310","documentation":"Thrown by WslCliInstaller.remove() when status.state is 'conflict' — a non-Orca command exists at the target path inside the WSL distro. Orca refuses to delete a command it didn't create. Note: the WSL remove() does not have a 'stale' guard like the host installer; only conflict and not_installed are handled.","triggerScenarios":"Calling remove() on WSL CLI when the status probe finds a non-Orca-managed command at commandPath. buildSafeRemoveCommand would refuse to remove an unowned file.","commonSituations":"Same as install conflict: another tool named 'orca' in WSL. A previous Orca WSL install was partially cleaned up. Manual file replacement in the WSL bin directory.","solutions":["Inspect the file inside WSL: 'wsl -d <distro> -- ls -la <commandPath>'.","If it's not needed, manually remove it inside WSL: 'wsl -d <distro> -- rm <commandPath>'.","If it's a different tool you need, no action needed — Orca correctly refused."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const status = await wslInstaller.getStatus()\nif (status.state === 'conflict') {\n  showInfo('The WSL command is not owned by Orca and will not be removed.')\n  return\n}","typeGuard":null,"tryCatchPattern":"try {\n  await wslInstaller.remove()\n} catch (error) {\n  if (error instanceof Error && error.message.includes('Refusing to remove non-Orca command')) {\n    // Safe no-op; foreign command are never removed\n  } else { throw error }\n}","preventionTips":["Check status.state before calling remove() on WSL CLI.","Note the WSL remove() has no 'stale' guard — only conflict and not_installed."],"tags":["cli-installer","wsl","removal","conflict","safety-guard"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}