stablyai/orca · error · Error

Could not find an available remote worktree path for "${sani

Error message

Could not find an available remote worktree path for "${sanitizedName}". Pick a different worktree name.

What it means

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.

Source

Thrown at src/main/ipc/worktree-remote.ts:1613

      effectiveSanitizedName,
      repo.path,
      worktreePathSettings,
      {
        useConfiguredAbsolutePath: hasRepoWorktreeBasePath(repo)
      }
    )
    if (!(await remotePathExists(fsProvider, remotePath))) {
      remotePathResolved = true
      break
    }
  }
  if (!remotePathResolved) {
    if (lastBranchConflictKind) {
      throw new Error(
        `Branch "${branchName}" already exists ${lastBranchConflictKind === 'local' ? 'locally' : 'on a remote'}. Pick a different ${branchConflictSubject}.`
      )
    }
    throw new Error(
      `Could not find an available remote worktree path for "${sanitizedName}". Pick a different worktree name.`
    )
  }

  validateWorkspaceLineageParentBeforeCreate(
    store,
    args.parentWorkspace,
    worktreeWorkspaceKey(`${repo.id}::${remotePath}`)
  )

  const sparseDirectories = args.sparseCheckout
    ? normalizeSparseDirectories(args.sparseCheckout.directories)
    : []
  if (args.sparseCheckout && sparseDirectories.length === 0) {
    throw new Error('Sparse checkout requires at least one repo-relative directory.')
  }
  let sparsePresetId: string | undefined
  if (args.sparseCheckout?.presetId) {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Choose a more unique worktree name.
  2. Remove orphaned remote directories left behind after partial deletes (register the root, then rm the stale paths).
  3. Increase the candidate suffix count or change the worktree path template.
Defensive patterns

Strategy: validation

Validate before calling

// Probe the remote path before submitting create
for (const candidate of buildNameCandidates(sanitizedName)) {
  const path = resolveRemoteWorktreePath(repo, candidate)
  if (!(await remotePathExists(fsProvider, path))) { return { ok: true, remotePath: path } }
}
return { ok: false, error: `All candidate paths for "${sanitizedName}" exist on the remote.` }

Try / catch

catch (err) {
  if (err instanceof Error && err.message.startsWith('Could not find an available remote worktree path')) {
    promptForDifferentWorktreeName()
  } else { throw err }
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/31ab8d2cd696f55f. Report an issue: GitHub.