Skip to content

refactor(ssh): remove the dead SSH filesystem provider and desktop SSH file watcher - #31922

Merged
nwparker merged 2 commits into
mainfrom
nwparker/remove-ssh-filesystem-provider
Oct 22, 2026
Merged

nwparker merged 2 commits into
mainfrom
nwparker/remove-ssh-filesystem-provider

Conversation

@nwparker

@nwparker nwparker commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 64 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​188 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3278 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3090
Prod 32 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​66 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1900 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1834

ELI5

Orca used to watch files on SSH machines through a component that no longer exists. The code that waited for that component stayed behind, about 5,000 lines of it with its tests, and it could never do anything. This PR deletes it. SSH, local, WSL and folder workspaces behave the same afterwards.

What Changed

When the SSH relay was removed (#27214/#27215), nothing in production called registerSshFilesystemProvider any more, so every getSshFilesystemProvider(...) lookup returned undefined. #27644 deleted the rest of that wiring but left this table and the desktop SSH file-watcher subsystem behind to be deleted together. This PR does that deletion.

  • Deleted:
    • src/main/providers/ssh-filesystem-dispatch.ts (the provider table and its registration hook).
    • All of filesystem-watcher-remote-*.ts (install, retry, dormant backoff, provider re-arm, resync, removal, desired-intent) and remote-watcher-event-batch.ts, with their remote-only tests.
  • Collapsed to the behaviour production already had (provider always undefined):
    • fs:watchWorktree / fs:unwatchWorktree: a request carrying a connectionId returns immediately. Before, it found no provider, retried every second for 60s, sent one forced refresh, then sat in a dormant backoff that never fired an install. No watch was ever installed either way.
    • Watcher lifecycle state, sender cleanup and closeAllWatchers: the remote maps, timers and constants are gone. The local path is unchanged.
    • WorktreeWatcherRemoval and runtime-file-watcher-removal.ts: removing a worktree no longer calls the remote close/restore/forget, which had nothing to act on. For SSH paths the file-explorer watcher teardown still runs as before.
    • Worktree base-directory watcher (worktree-base-directory-watch-targets.ts, worktree-base-directory-watcher.ts):
      • Only local repos produce targets. An SSH repo used to return early at if (connectionId && !remoteProvider) return.
      • canonicalizeExistingPath, getRemoteProvider, the SSH layout branch, handleRemoteWatchEvents, collectRemoteWorktreeBaseChanges and the remote-access parameter of resolveWorktreeCommonGitDirectory are gone.
      • The never-set connectionId field on WorktreeBaseWatchTarget is gone. The two consumers that compared it now compare against "no connection", which is what it always was: git-status ref matching and the catalog notifier.
  • Not touched: remote file listing and watching through the managed orcad server (subscribeRuntimeTarget in the renderer, runtime file RPCs).
  • Repo-host-read ratchet: the count is unchanged at 79, because none of the deleted code read repo.connectionId directly. There is no baseline to lower.
  • Reliability gates: the renderer-document-watch-ownership gate no longer lists the deleted SSH test file or the removed SSH assertions. Its evidence run is refreshed from a local run. Two stale SSH assertion names were dropped from the worktree-catalog gate.

Visible behaviour: none. The only differences are internal and unobservable to a user:

  • No "SSH filesystem provider unavailable" warning is logged.
  • The retry and backoff timers no longer run for SSH roots that could never be watched.
  • The single forced refresh the give-up path sent 60s later is gone. It refreshed against a watch that never existed.

Why

The table had no writer, so every branch reading it was dead. That made the watcher lifecycle much harder to reason about, and it kept SSH-specific state machines alive that tests exercised but production never reached. The alternative, keeping the subsystem in case a desktop-side SSH transport comes back, was rejected. SSH file watching now lives on the managed server, and a future transport would be built against that path, not this one.

Mixed versions: no wire or IPC shape changes. The fs:watchWorktree channel and its args are unchanged, and an older or newer renderer sending connectionId gets the same resolved promise with no watch.

Linked Issue

N/A (internal cleanup, follow-up to #27644).

Visual Proof

N/A: no UI or behaviour change. The deleted code never ran in production.

Testing

  • Confirmed there are no production callers: git grep for registerSshFilesystemProvider / getSshFilesystemProvider / onSshFilesystemProviderRegistered across the whole tree (main, preload, renderer, mobile, CLI, relay, orcad, packages) found only the deleted module, the watcher code it fed, and test mocks.

  • Updated the local-path tests that used to run both local and SSH variants to run local only. Added one guard: an SSH watch request never stats or subscribes on the local disk.

  • pnpm test src/main/ipc/filesystem src/main/ipc/worktree src/main/ipc/watched-worktree src/main/runtime/orca-runtime.test.ts src/main/runtime/runtime-file (single worker): 2968 pass. Four failures also fail on unmodified origin/main on this machine: two real-@parcel/watcher delivery tests, and two macOS /private/var tmpdir path tests.

  • Ran every step of the "static analysis and typecheck" job locally (lint, format, anti-slop, code-quality, typecheck:ci, reliability gates, ratchets, generators): all pass.

  • Verified live vs tests: nothing was verified on a live machine. There is no runtime path left to exercise, and the removed code was unreachable in production.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

📝 Walkthrough

The change removes SSH-backed desktop filesystem watcher installation, event batching, retries, resync, and removal handling. Filesystem watch requests with a connection ID now return without remote watcher work. Worktree-base targets and event handling use local filesystem paths, and watcher-removal interfaces retain local operations. Tests and reliability-gate evidence are updated to reflect the remaining local watcher coverage.

Priority: ⬇️ Low

Merge Risk: 🔵 Low · up to 47674

Remove the stale SSH watcher claim before merging so reliability-gate coverage accurately reflects the supported watcher behavior.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 23 files. (1 skipped: … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the removal of the unused SSH filesystem provider and desktop SSH file watcher.
Description check Passed The description is detailed and covers the required explanation, scope, rationale, testing, visual proof, compatibility impact, and checklist. It identifies the linked issue context as internal cleanu…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description is detailed and covers the required explanation, scope, rationale, testing, visual proof, compatibility impact, and checklist. It identifies the linked issue context as internal cleanup and references the existing follow-up issues.

Full details: Docstring Coverage

Explanation

Docstring coverage is 8.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 24 functions across 23 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

…H file watcher

Nothing in production has registered an SSH filesystem provider since the
relay removal (#27214/#27215), so every getSshFilesystemProvider read
returned undefined. Delete the provider table and the remote watcher
subsystem, and collapse the call sites to that always-undefined behaviour:
fs:watchWorktree/fs:unwatchWorktree ignore SSH roots, the worktree base
watcher only resolves local repos, and worktree removal skips the desktop
watcher for SSH paths.
The base-directory watcher never carries a connection id now, so the
host-blind-event guard it exercised is gone. Also prune the deleted remote
watcher suites from the shard timings and the nested-SSH wording from the
worktree catalog reliability gate.
@nwparker
nwparker force-pushed the nwparker/remove-ssh-filesystem-provider branch from 45706dc to 476743d Compare October 22, 2026 08:31

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Remove the obsolete SSH watcher gap. · reliability-gates.jsonc:4743-4744

config/reliability-gates.jsonc:4743-4744
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the obsolete SSH watcher gap.

The desktop worktree watcher no longer installs watchers for SSH repositories, so it cannot classify SSH head-move triggers. Remove line 4743. Keep line 4744 because it records the separate direct-SSH journey and its remaining multi-target and catalog gaps.

Suggested fix
-        "SSH watches classify head-move triggers but skip the metadata-read identity diff; remote background-worktree heads still wait on a structural event or activation.",
         "The Docker/Linux journey covers one direct SSH target; a live multi-target fanout and large-catalog benchmark remains missing.",

ℹ️ Review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8ead0679-c663-4243-a681-9b46973e5197
📥 Commits

Reviewing files that changed from the base of the PR and between 45706dc4e0f20c414a754f8246fe0d8b48c18433 and 476743d.

📒 Files selected for processing: 3
  • config/reliability-gates.jsonc
  • config/scripts/ci-shard-timings.json
  • src/main/runtime/external-worktree-paired-client-discovery.integration.test.ts
💤 Files with no reviewable changes: 2
  • src/main/runtime/external-worktree-paired-client-discovery.integration.test.ts
  • config/scripts/ci-shard-timings.json

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@nwparker
nwparker merged commit dc315a4 into main Oct 22, 2026
48 of 49 checks passed
Chihen-Tai added a commit to Chihen-Tai/orca that referenced this pull request Nov 20, 2026
SSH workspaces now run on the host's managed runtime, and the desktop
SSH filesystem provider is gone (stablyai#31922), so the bare-SSH Host branch
could list folders but never open a file. Host mode now browses any
runtime-owned workspace through its runtime: files.browseServerDir
lists the folder, files.resolveTerminalPath classifies a click, a file
inside the workspace opens through the normal writable path with its
runtime owner, and a file outside it opens read-only on the host's
single-file grant at the canonical path the grant is bound to.

Hosts without outside-file grants answer "absent" for every outside
path, so an outside symlink is entered when it lists as a folder, and
any other outside path shows the same "update Orca on this host"
refusal Quick Open shows. The bare-SSH source and main's SSH
connectionId stub are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant