Skip to content

refactor(providers): delete the SSH git and filesystem providers and relay-only wiring - #27644

Merged
OrcaWin merged 2 commits into
mainfrom
OrcaWin/p399-B7
Oct 12, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
OrcaWin/p399-B7

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 203 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​517 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10168 $\color{#cf222e}{\Huge{\mathbf{−}}}$​9651
Prod 102 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​342 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4484 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4142

ELI5

The old SSH relay is gone, but the code that used it to read files and run git on an SSH host was still here. Nothing ever switched that code on any more, so every call either did nothing or failed with "Remote connection dropped". This PR deletes that code and points each caller straight at the answer it was already getting.

What Changed

Before: about 50 places checked "is there an SSH git or file provider for this connection?" No production code registers one any more, so the answer was always no. Behind those checks sat the SSH git provider (about 1,200 lines), its stream readers, a direct-SSH "authority" check that always said no, a placeholder multiplexer lookup that always threw, and the code each of them fed: remote transcript readers, a remote disk-usage scan, SSH upload and download helpers, and the remote clipboard copy.

After: each caller does what it already did when the provider was missing:

  • Git and file work on an SSH repo throws the existing typed SshHostNotServedError, with the same message as before ("Remote connection dropped…", or the "SSH Git provider is not available…" text for the PR and MR head fetches). Paths that used to quietly answer nothing still do: remote URL probes return null, template reads return an empty string, hook reads report an error, the workspace scan lists the stored rows, a media preview returns 404, and folder path status is unavailable.
  • Cache keys drop the provider "generation". It was always 0, because nothing registered a provider.
  • ipc/ssh.ts stops re-exporting the registry. ssh-target-registry.ts loses getActiveMultiplexer and the direct-authority resolver, and the migration fence, the delta move and the conversion lose their direct-session guard. The guard was always false.
  • Deleted outright: ssh-git-* providers and dispatch, ssh-git-response-stream-reader, ssh-filesystem-stream-reader, ssh-file-stream-read-cap, ssh-plain-ssh-mode, shared/git-exec-mutation, workspace-space-remote-scan, worker-transcript-remote-{read,range-read}, ssh-file-explorer-chunk-read, filesystem-import-ssh*, filesystem-download-folder (the channel stays registered and throws the typed error, like fs:downloadFile), and local-downloaded-folder-promotion. The tests and harness mocks that only covered these went with them.

Kept on purpose: providers/ssh-filesystem-dispatch.ts, cut to the four functions that the remote file-watcher code still calls (both the per-worktree watcher and the base-directory watcher). That watcher code is a bigger piece of its own (about 1k lines), tied into worktree removal, so it gets its own follow-up PR, and the table is deleted with it. Native chat's SSH transcript path parser also stays. Its two read functions now throw the typed error.

Small changes on paths that already failed, all accepted for this phase:

  • SSH upload and drop (fs:importExternalPaths, fs:resolveDroppedPathsForAgent) now throw the typed error right away. Before, they first checked the connection state, and they returned an empty result when no paths were given.
  • An SSH remote watch now always reports "unavailable". Before, it retried for 60 s first.

Net: production −3,895 lines (+330/−4,225), tests −9,830 lines (+528/−10,358); 303 files.

Why

Per Phase 3.99 PR B7. Every arm deleted here was already dead: nothing calls registerSsh{Git,Filesystem}Provider or setDirectSshAuthorityResolver, and getActiveMultiplexer always threw. Keeping the dead arms meant every new git or file caller copied a branch that could never run. We could have kept the provider modules as empty stubs, but then the dead branches would stay in place and look as if they could run. Deleting them means the compiler finds every remaining reader.

Proof the code is dead:

  • rg across src, config, mobile and packages, including all @ts-nocheck files, finds no reference to any deleted module or symbol.
  • pnpm tc, build:electron-vite, build:cli and build:orcad all succeed.
  • The getActiveMultiplexer callers listed in the design's addendum were already removed by B4/B6. This PR deletes the function itself.

Linked Issue

Phase 3.99 (owner-approved cleanup plan), PR B7.

Visual Proof

N/A. No UI change. Every touched path already failed or returned nothing for SSH hosts.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

pnpm tc, pnpm lint (all ratchets OK), pnpm run check:code-quality:changed (0 new findings), build:electron-vite, build:cli and build:orcad all pass. All changed test files pass, plus orca-runtime.test.ts, src/main/window/, src/main/gitlab/ and the filesystem IPC suites (264 files, 4,205 tests). Tests that only exercised a registered SSH provider are deleted. Where a test protected routing (no local fallback, the typed error, the host-scoped stored rows), it now asserts the not-served outcome or lists the stored rows.

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

  • SSH: unreachable SSH work still throws or reports unavailable. It never falls back to this machine, and it never reports exited.
  • Wire: no RPC or IPC channel is removed or renamed. fs:downloadFolder stays registered.
  • Folder workspaces: SSH folder path status reports unavailable, as it already did in production.
  • The managed-orcad (runtime:) and cloud/mobile relay paths are untouched.

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)

@OrcaWin
OrcaWin marked this pull request as ready for review October 12, 2026 00:48
@OrcaWin
OrcaWin merged commit c5224f7 into main Oct 12, 2026
38 checks passed
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