stablyai/orca · error · Error

SSH filesystem provider lstat unavailable

Error message

SSH filesystem provider lstat unavailable

What it means

Thrown immediately after the SSH filesystem provider availability check when the provider exists but its lstat method is missing. canSafelyRemoveOrphanedWorktreeDirectory needs lstat (and readFile) to validate the orphan directory before deletion; a provider without lstat cannot satisfy the safety check.

Source

Thrown at src/main/ipc/worktrees.ts:2462

            worktreePath,
            registeredWorktrees
          )
          if (!registeredWorktree) {
            const fsProvider = repo.connectionId
              ? getSshFilesystemProvider(repo.connectionId)
              : null
            let canCleanOrphanedDirectory = false
            if (
              canCleanupUnregisteredOrcaWorktreeDirectory({
                meta: removedMeta
              })
            ) {
              if (repo.connectionId) {
                if (!fsProvider) {
                  throw new Error('SSH filesystem provider unavailable')
                }
                if (!fsProvider.lstat) {
                  throw new Error('SSH filesystem provider lstat unavailable')
                }
                canCleanOrphanedDirectory = await canSafelyRemoveOrphanedWorktreeDirectory(
                  worktreePath,
                  repo.path,
                  (path) => fsProvider.lstat!(path),
                  (path) => fsProvider.readFile(path)
                )
              } else {
                const access = getLocalWorktreePathAccess(localWorktreeGitOptions)
                canCleanOrphanedDirectory =
                  !isDangerousWorktreeRemovalPath(worktreePath, repo.path) &&
                  (await canSafelyRemoveOrphanedWorktreeDirectory(
                    toLocalWorktreeRuntimePath(worktreePath, localWorktreeGitOptions),
                    toLocalWorktreeRuntimePath(repo.path, localWorktreeGitOptions),
                    access.statPath,
                    access.readPath
                  ))
              }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Update the SSH host/relay to a filesystem provider version that implements lstat.
  2. Reconnect to re-negotiate provider capabilities after upgrading the remote side.
  3. If lstat can't be provided, clear the orphaned directory manually on the host and retry removal (it will then take the already-removed path).
Defensive patterns

Strategy: validation

Validate before calling

const caps = await invoke('ssh:filesystemProviderCapabilities', repo.connectionId)
if (!caps?.lstat) {
  throw new Error('SSH filesystem provider lacks lstat; upgrade the host/relay')
}

Type guard

function hasLstat(provider: unknown): provider is { lstat: (p: string) => Promise<unknown> } {
  return !!provider && typeof (provider as any).lstat === 'function'
}

Prevention

When it happens

Trigger: An SSH filesystem provider implementation is registered for the connection but does not implement lstat (older/partial provider), and a remove hits the SSH orphaned-directory cleanup path.

Common situations: Provider version skew between client and host — an older SSH filesystem relay that predates the lstat capability, or a custom provider missing the method.

Related errors


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