Repository navigation
refactor(ssh): remove the dead SSH filesystem provider and desktop SSH file watcher - #31922
Conversation
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
…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.
45706dc to
476743d
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.
🟡 Minor · Remove the obsolete SSH watcher gap. · reliability-gates.jsonc:4743-4744
config/reliability-gates.jsonc:4743-4744
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRemove 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.jsoncconfig/scripts/ci-shard-timings.jsonsrc/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.
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>
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
registerSshFilesystemProviderany more, so everygetSshFilesystemProvider(...)lookup returnedundefined. #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.src/main/providers/ssh-filesystem-dispatch.ts(the provider table and its registration hook).filesystem-watcher-remote-*.ts(install, retry, dormant backoff, provider re-arm, resync, removal, desired-intent) andremote-watcher-event-batch.ts, with their remote-only tests.fs:watchWorktree/fs:unwatchWorktree: a request carrying aconnectionIdreturns 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.closeAllWatchers: the remote maps, timers and constants are gone. The local path is unchanged.WorktreeWatcherRemovalandruntime-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-watch-targets.ts,worktree-base-directory-watcher.ts):if (connectionId && !remoteProvider) return.canonicalizeExistingPath,getRemoteProvider, the SSH layout branch,handleRemoteWatchEvents,collectRemoteWorktreeBaseChangesand the remote-access parameter ofresolveWorktreeCommonGitDirectoryare gone.connectionIdfield onWorktreeBaseWatchTargetis 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.subscribeRuntimeTargetin the renderer, runtime file RPCs).repo.connectionIddirectly. There is no baseline to lower.renderer-document-watch-ownershipgate 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:
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:watchWorktreechannel and its args are unchanged, and an older or newer renderer sendingconnectionIdgets 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 grepforregisterSshFilesystemProvider/getSshFilesystemProvider/onSshFilesystemProviderRegisteredacross 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/watcherdelivery tests, and two macOS/private/vartmpdir 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
Notes
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)