{"record":{"id":"d7a4aac57ebc6ea9","repo":"stablyai/orca","slug":"ssh-host-platform-is-unavailable-reconnect-the-ss","errorCode":null,"errorMessage":"SSH host platform is unavailable. Reconnect the SSH target before cloning.","messagePattern":"SSH host platform is unavailable\\. Reconnect the SSH target before cloning\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/repos.ts","lineNumber":496,"sourceCode":"  store: Store,\n  mainWindow: BrowserWindow,\n  args: {\n    connectionId: string\n    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)) {","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/repos.ts#L478-L514","documentation":"Thrown when gitProvider.getHostPlatform?.() returns falsy. The host platform carries the pathFlavor ('posix' or 'windows') used to validate paths and join segments; without it the clone cannot determine absolute-path semantics or correctly join the destination and repo name. Treated as a recoverable relay-protocol gap — 'reconnect' is the remedy.","triggerScenarios":"The git provider exists (so 1272 passed) but does not expose getHostPlatform, or it returns undefined/null. Possible with an older relay that predates the host-platform RPC, or a provider implementation that lazily populates the platform and has not yet received it from the relay.","commonSituations":"Older SSH relay version that does not report host platform; connection handshake completed but the platform descriptor hasn't landed yet; relay that supports git clone but not platform detection (rare custom relay).","solutions":["Reconnect the SSH target so the host platform is re-fetched from the relay handshake.","Upgrade the relay to a version that advertises getHostPlatform.","Guard the clone call: if (!gitProvider.getHostPlatform?.()) defer the clone until the platform is available.","If the relay truly cannot report a platform, the clone is unsupported — file a relay-side fix."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"import { getSshGitProvider } from '../providers/ssh-git-dispatch'\n\nfunction connectionHasHostPlatform(connectionId: string): boolean {\n  return !!getSshGitProvider(connectionId)?.getHostPlatform?.()\n}","typeGuard":"function isSshHostPlatformUnavailable(err: unknown): boolean {\n  return err instanceof Error && err.message === 'SSH host platform is unavailable. Reconnect the SSH target before cloning.'\n}","tryCatchPattern":"try {\n  await cloneRemoteRepo(store, mainWindow, { connectionId, url, destination })\n} catch (err) {\n  if (isSshHostPlatformUnavailable(err)) {\n    await reconnect(connectionId)\n    return retry()\n  }\n  throw err\n}","preventionTips":["Reconnect the SSH target if the host platform is missing — the handshake repopulates it.","Upgrade the relay to a version that advertises getHostPlatform.","Gate the clone UI on connectionHasHostPlatform(connectionId)."],"tags":["ssh","clone","host-platform","relay","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}