stablyai/orca · error

SSH filesystem provider unavailable for ${target.connectionI

Error message

SSH filesystem provider unavailable for ${target.connectionId}

What it means

Thrown by subscribeTarget in the worktree base-directory watcher when target.connectionId is set but getSshFilesystemProvider(target.connectionId) returns a falsy value. The SSH filesystem provider is the abstraction that watches remote paths over the relay; without it, remote file-change events cannot be delivered, so subscribing is impossible. The error identifies which connectionId lacks a provider so the caller can reconnect that target.

Source

Thrown at src/main/ipc/worktree-base-directory-watcher.ts:146

    pendingHeadIdentityRepoIds: new Set(),
    headIdentityRefresh: createWorktreeHeadIdentityRefreshState(),
    gitStatusRefPaths,
    watcherFailureRefresh: new WorktreeWatcherFailureRefreshCooldown(),
    disposed: false
  }
}

async function subscribeTarget(
  target: WorktreeBaseWatchTarget,
  mainWindow: BrowserWindow
): Promise<ActiveWatch> {
  let activeWatch: ActiveWatch | null = null
  const gitStatusRefPaths = new Set<string>()
  applyActiveGitStatusRefBinding({ ...target, gitStatusRefPaths })
  if (target.connectionId) {
    const provider = getSshFilesystemProvider(target.connectionId)
    if (!provider) {
      throw new Error(`SSH filesystem provider unavailable for ${target.connectionId}`)
    }
    const unwatch = await provider.watch(target.path, (events) => {
      const currentWatch = activeWatches.get(target.key) ?? activeWatch
      if (!currentWatch || currentWatch.disposed) {
        return
      }
      handleRemoteWatchEvents(currentWatch, events)
    })
    activeWatch = createActiveWatch(
      target,
      mainWindow,
      { unsubscribe: async () => unwatch() },
      gitStatusRefPaths
    )
    return activeWatch
  }

  // Why: a recursive native watcher here forced fseventsd to deliver every

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Reconnect the SSH target so its filesystem provider is (re)registered, then re-subscribe.
  2. Sequence watcher setup after the connection-ready event for the connectionId, not on target-list load.
  3. If the target should be local, clear its connectionId before subscribing.
Defensive patterns

Strategy: validation

Validate before calling

if (target.connectionId && !getSshFilesystemProvider(target.connectionId)) {
  await reconnectTarget(target.connectionId)
}
await subscribeTarget(target, mainWindow)

Type guard

function hasSshFsProvider(connectionId: string): boolean {
  return getSshFilesystemProvider(connectionId) !== undefined
}

Try / catch

try {
  await subscribeTarget(target, mainWindow)
} catch (e) {
  if (/SSH filesystem provider unavailable/.test((e as Error).message)) {
    await reconnectTarget(target.connectionId!)
    await subscribeTarget(target, mainWindow)
  } else throw e
}

Prevention

When it happens

Trigger: subscribeTarget is called for a remote worktree target whose SSH connection lost its filesystem provider — e.g. the relay was reset, the connection dropped, or the provider was never registered for that connectionId. The target carries a connectionId (so it expects remote watching) but no provider is mapped to it.

Common situations: Watcher subscription races ahead of connection-ready. Relay reset cleared providers but the watcher list still references the target. A reconnect is mid-flight and the new provider is not yet registered.

Related errors


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