{"record":{"id":"1dc85b682558f431","repo":"stablyai/orca","slug":"clone-destination-must-be-an-absolute-path-on-the","errorCode":null,"errorMessage":"Clone destination must be an absolute path on the SSH host","messagePattern":"Clone destination must be an absolute path on the SSH host","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/repos.ts","lineNumber":500,"sourceCode":"    url: string\n    destination: string\n  }\n): Promise<Repo> {\n  const gitProvider = getSshGitProvider(args.connectionId)\n  if (!gitProvider) {\n    throw new Error(`SSH connection \"${args.connectionId}\" not found or not connected`)\n  }\n  const fsProvider = getSshFilesystemProvider(args.connectionId)\n  if (!fsProvider) {\n    throw new Error(`SSH connection \"${args.connectionId}\" not found or not connected`)\n  }\n  const host = gitProvider.getHostPlatform?.()\n  if (!host) {\n    throw new Error('SSH host platform is unavailable. Reconnect the SSH target before cloning.')\n  }\n  const trimmedDestination = await resolveRemoteHomePath(args.connectionId, args.destination.trim())\n  if (!isRuntimePathAbsolute(trimmedDestination, host.pathFlavor)) {\n    throw new Error('Clone destination must be an absolute path on the SSH host')\n  }\n  const repoName = deriveCloneRepoNameFromUrl(args.url.trim())\n  const clonePath = joinRemotePath(host, trimmedDestination, repoName)\n  if (relativePathInsideRoot(trimmedDestination, clonePath) === null) {\n    throw new Error('Clone path must be inside the destination directory')\n  }\n  const clonePathKey = normalizeRuntimePathForComparison(clonePath)\n  const existing = store.getRepos().find((repo) => {\n    return (\n      repo.connectionId === args.connectionId &&\n      normalizeRuntimePathForComparison(repo.path) === clonePathKey\n    )\n  })\n  if (existing && !isFolderRepo(existing)) {\n    emitRepoAdded('clone_url', true)\n    return existing\n  }\n","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/repos.ts#L482-L518","documentation":"Thrown when isRuntimePathAbsolute(trimmedDestination, host.pathFlavor) is false. Path absoluteness is flavor-dependent: posix requires a leading '/', windows requires 'drive:/' or '//'. The destination is first trimmed and run through resolveRemoteHomePath (which expands '~' via session.resolveHome). If after that it is not absolute in the host's flavor, the clone cannot safely proceed.","triggerScenarios":"Passing a relative destination ('repos/myrepo'), a tilde that did not expand ('~' returned as-is because the relay lacked session.resolveHome), or a Windows-style path on a posix host (or vice versa). isRuntimePathAbsolute checks flavor: 'C:\\\\' on posix returns false; '/home/x' on windows returns false.","commonSituations":"UI defaulted to a relative path; user typed 'myrepo' expecting it under home but no tilde expansion happened; cross-flavor mistake (Windows path on a Linux SSH host); older relay that didn't implement session.resolveHome returning '~' verbatim.","solutions":["Provide an absolute path in the host's flavor: '/home/user/repos' on posix, 'C:/Users/me/repos' or '//server/share/repos' on windows.","Prefix the path with '~/...' so resolveRemoteHomePath expands it; if expansion silently failed, upgrade the relay to one that supports session.resolveHome.","Detect the host.pathFlavor up front and validate the destination against it before calling the clone IPC.","Trim leading/trailing whitespace and stray quotes that can break absoluteness detection."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { isRuntimePathAbsolute } from '../../shared/cross-platform-path'\nimport type { RemoteHostPlatform } from '../ssh/ssh-remote-platform'\n\nfunction destinationIsAbsoluteForHost(destination: string, host: RemoteHostPlatform): boolean {\n  return isRuntimePathAbsolute(destination.trim(), host.pathFlavor)\n}","typeGuard":"function isCloneDestinationNotAbsolute(err: unknown): boolean {\n  return err instanceof Error && err.message === 'Clone destination must be an absolute path on the SSH host'\n}","tryCatchPattern":"if (!destinationIsAbsoluteForHost(destination, host)) {\n  surfaceUserAction(`Provide an absolute path in the host's format (e.g. /home/user/repos or C:/Users/me/repos).`)\n  return\n}\nawait cloneRemoteRepo(store, mainWindow, { connectionId, url, destination })","preventionTips":["Validate the destination against host.pathFlavor before invoking the clone IPC.","Prefer '~/...' so resolveRemoteHomePath expands it; if expansion is unreliable, upgrade the relay.","Trim whitespace and stray quotes from the destination before submission."],"tags":["ssh","clone","path-validation","absolute-path","cross-platform"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}