{"record":{"id":"31ab8d2cd696f55f","repo":"stablyai/orca","slug":"could-not-find-an-available-remote-worktree-path-f","errorCode":null,"errorMessage":"Could not find an available remote worktree path for \"${sanitizedName}\". Pick a different worktree name.","messagePattern":"Could not find an available remote worktree path for \"(.+?)\"\\. Pick a different worktree name\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ipc/worktree-remote.ts","lineNumber":1613,"sourceCode":"      effectiveSanitizedName,\n      repo.path,\n      worktreePathSettings,\n      {\n        useConfiguredAbsolutePath: hasRepoWorktreeBasePath(repo)\n      }\n    )\n    if (!(await remotePathExists(fsProvider, remotePath))) {\n      remotePathResolved = true\n      break\n    }\n  }\n  if (!remotePathResolved) {\n    if (lastBranchConflictKind) {\n      throw new Error(\n        `Branch \"${branchName}\" already exists ${lastBranchConflictKind === 'local' ? 'locally' : 'on a remote'}. Pick a different ${branchConflictSubject}.`\n      )\n    }\n    throw new Error(\n      `Could not find an available remote worktree path for \"${sanitizedName}\". Pick a different worktree name.`\n    )\n  }\n\n  validateWorkspaceLineageParentBeforeCreate(\n    store,\n    args.parentWorkspace,\n    worktreeWorkspaceKey(`${repo.id}::${remotePath}`)\n  )\n\n  const sparseDirectories = args.sparseCheckout\n    ? normalizeSparseDirectories(args.sparseCheckout.directories)\n    : []\n  if (args.sparseCheckout && sparseDirectories.length === 0) {\n    throw new Error('Sparse checkout requires at least one repo-relative directory.')\n  }\n  let sparsePresetId: string | undefined\n  if (args.sparseCheckout?.presetId) {","sourceCodeStart":1595,"sourceCodeEnd":1631,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/worktree-remote.ts#L1595-L1631","documentation":"Remote worktree create exhausted all candidate remote paths (each already exists on the host) but there was NO recorded branch conflict — lastBranchConflictKind is null. This is a pure path-collision failure: the sanitizedName plus suffixes all mapped to existing directories on the remote filesystem. The message asks for a different worktree name because no branch dimension is at fault.","triggerScenarios":"Remote create path loop where remotePathExists(fsProvider, remotePath) returns true for every candidate and no branch conflict was encountered earlier. Reached at worktree-remote.ts:1613 (the else branch after the branch-conflict throw).","commonSituations":"Many worktrees with the same base name already exist on the remote (suffixes 2,3,4... all taken); leftover directories from deleted worktrees whose git metadata was removed but folders remain; very long names truncating to collisions.","solutions":["Choose a more unique worktree name.","Remove orphaned remote directories left behind after partial deletes (register the root, then rm the stale paths).","Increase the candidate suffix count or change the worktree path template."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Probe the remote path before submitting create\nfor (const candidate of buildNameCandidates(sanitizedName)) {\n  const path = resolveRemoteWorktreePath(repo, candidate)\n  if (!(await remotePathExists(fsProvider, path))) { return { ok: true, remotePath: path } }\n}\nreturn { ok: false, error: `All candidate paths for \"${sanitizedName}\" exist on the remote.` }","typeGuard":null,"tryCatchPattern":"catch (err) {\n  if (err instanceof Error && err.message.startsWith('Could not find an available remote worktree path')) {\n    promptForDifferentWorktreeName()\n  } else { throw err }\n}","preventionTips":["Use distinctive worktree names to avoid path collisions.","Prune orphaned remote directories after deletes.","Expand the naming template's suffix space if collisions are frequent."],"tags":["worktree-create","path-collision","ssh","remote","naming"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}