Repository navigation
refactor(providers): an ssh: route carries no provider and throws one typed error - #27477
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
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. Comment |
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
The old way of driving an SSH host (the relay) is gone, but the code that routed git and file work to an "SSH provider" still pretended one might show up. None ever does. Now a request routed to an
ssh:host stops straight away with one clear error, using the same words people already see, instead of carrying an empty provider around and checking it everywhere.What Changed
resolveGitRouteForHost/resolveFilesystemRouteForHostreturn{ kind: 'ssh', hostId, connectionId }for anssh:host — noproviderfield.requireReachableGitRoute/requireReachableFilesystemRoutenow return only the local route and throw a newSshHostNotServedError(src/main/providers/ssh-host-not-served-error.ts) forssh:, with today's text: "Remote connection dropped. Click Reconnect on the SSH target before retrying."requireGitProviderForHost/requireFilesystemProviderForHostare deleted (two@ts-nocheckruntime-file callers moved torequireSshFilesystemProvider, same error).getActiveMultiplexer. Its resolver setter had no production caller, so every call threw the internal wiring errorssh_active_multiplexer_resolver_not_installed. It now throws the same typed "not served" error. This is the one accepted behaviour change: on paths that already failed (agent detection, remote preflight, port scanning, external-manager discovery, SSH worktree root registration, remote repo clone/scan), people see "Remote connection dropped…" instead of an internal code.Before → after for a user: nothing changes on local, WSL, folder-workspace or paired-runtime (
runtime:) work. On anssh:row, the same operations fail as before with the same message; the only visible difference is the friendlier message where the wiring code used to leak.Why
The
providerfield on anssh:route was alwaysnullin production, yet every caller had to branch on it, and new git/file code kept copying that branch. Making the route provider-less and throwing at one place removes those branches, and the type system now stops new code from reaching for an SSH provider through the shared router. Considered: (a) keep the field and only add the typed error — leaves every dead branch; (b) also delete the derived SSH arms here — that pulls in the B3–B6 files and ~150 more test files, so it is split out.Net lines (vs. main): production −417 (28 files), tests −931 (22 files).
Linked Issue
Phase 3.99, PR B2 (internal cleanup plan).
Visual Proof
N/A — no UI change; only the error text on already-failing SSH paths.
Testing
Characterization:
execution-host-provider-dispatch.test.tsasserts everyssh:route throwsSshHostNotServedErrorwith the existing message, with and without a registered provider, and that anssh:route never carries a local provider factory.ssh/ssh-target-registry.test.tsproves the wiring error is gone. Handler tests (git:status,git:abortMerge,git:abortRebase,git:commit,git:conflictOperation, upstream-ref watch, hosted review, native-chat artifact) assert the typed refusal and that nothing ran locally.Tests that only exercised a registered SSH provider through these handlers (a state production cannot reach) were removed.
Dead-code proof:
rg -wofrequireGitProviderForHost|requireFilesystemProviderForHost|setSshActiveMultiplexerResolver|ReachableGitRoute|ReachableFilesystemRoute|detectRemoteImageIcon|detectRemotePackageHomepageIcon|requireHostedReviewSshProvideroversrc config scripts tests mobile packages .github→ 0 hits (includes all@ts-nocheckfiles; the two@ts-nocheckcallers were found this way and fixed).registerSsh{Git,Filesystem}Provider,setSshActiveMultiplexerResolverandsetSshPlainSshModehave no production caller.pnpm tc,pnpm lint,pnpm run check:code-quality:changed,build:electron-vite,build:cli,build:orcadpass; 253 related test files (4441 tests) pass.macOS locally; Linux/Windows via CI.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
P0/P1 review: self + independent reviewer.
Agent skill upstream boundary
Notes
SSH: an
ssh:host never falls through to local — it throws, or keeps its structured "unavailable"/nullresult where the caller already had one. Wire: nothing a client and server exchange changes. Folder workspaces and WSL: local arms untouched.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)