Repository navigation
refactor(ssh): delete relay-only GC, takeover and install remnants - #27770
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to This change removes unused SSH relay cleanup, takeover and install code, and narrows garbage collection to orcad installs. No concrete user-facing regression was found. The owners should confirm before merge that restoring the legacy relay terminal bridge does not need any of the deleted helpers. Pre-merge checks |
|
|
Held: the legacy relay terminal bridge is being restored so users upgrading from 1.4.224 keep their running terminals. This PR deletes relay leftovers that the bridge may need. It will be re-checked against the bridge before it merges. |
fa73b4c to
9dcbc02
Compare
ELI5
The old SSH "relay" was removed a few releases ago, but a lot of code that cleaned up after it, took over its sockets, or installed its pieces was left behind. Nothing in the app calls that code any more. This PR deletes it, so the code that is left is the code that actually runs.
What Changed
Users see no difference. Nothing deleted here had a production caller after #27214.
Deleted outright (relay-only, no production caller):
gcOldRelayVersions, the relay liveness probe (relay-version-dir-liveness), the "previous build" pin (remote-install-previous-version), and the relay native-dependency cache and its cleanup (ssh-relay-native-deps-*).ssh-relay-endpoint-takeover(the "reap an empty relay" kill), the superseded-endpoint sweep, the held/unresponsive endpoint errors, and the handshake-refusal helpers.ssh-relay-install-namespace, the short-socket-path relocation (relay-socket-path-limitkeeps only the directory prefix the host census still lists), the Windows relay launch script (only the connect command the census uses is kept), and relay-only command builders inssh-remote-commands(relay probe, relay listing, relay liveness, directory-exists, mkdir/chmod).isRelayAlreadyInstalled,computeRemoteRelayDir,relayHookEndpointDirForHost,windowsActivePipeMarkerPath,isWindowsRelayPipePath,strictestHostKeyChecking,loadKnownHostsEntries(tests use the evidence reader it wrapped),writeStringsViaSftp, the host-Node "addon-only" probe and its parsers, three unused SFTP filesystem helpers plusssh-sftp-directory-close,resolveWindowsAgentForegroundProcess,classifyLoginPreflightError, the unused relay grace-period constants andrelay.configureGraceTimemethod name,RELAY_PID_FILENAME, and the relay Windows breakaway contract.offerMoveon a relay server status: older hosts may still send it; the admission code now drops it (nothing ever read it). Wire-safe: an optional field the receiver ignored.Kept, and renamed in place because this PR edits them:
ssh-relay-versioned-install→remote-versioned-install(orcad's install probe/finalize),ssh-relay-gc-tombstone→remote-install-gc-tombstone. The re-export of the GC from the versioned-install module is gone;orcad-remote-gcimports the GC from its own file.The read-only relay census that converts relay-era hosts (≤1.4.223) is untouched apart from one move: the four-line classification it borrowed from the deleted sweep now lives in
ssh-host-relay-endpoint-census.ts(readRelayEndpointProbe, same verdicts, its tests moved with it).One small fix on a path that was already failing: the orcad GC's leftover-tombstone cleanup only matched
relay-*names, so orcad's own interrupted-GC leftovers (orcad-<v>.gc-tombstone.<pid>.<ts>) were never removed. The cleanup now matches the model's own prefix (remoteInstallGcTombstoneRegex). It still never touches the other model's directories.Net: production −2,393 lines (+123 / −2,516), tests −2,924 (+265 / −3,189), config −1.
Why
Every one of these modules was only reachable from relay code that #27214/#27215 removed. Keeping them meant new SSH work had to step around a GC, takeover and installer that never run, and their tests kept pinning behaviour no user can reach. The shared GC pass, install lock, GC claim and tombstone code that orcad does run are kept, and the tests that exercised them through the relay entry point now drive the same pass with the orcad model, so that coverage is not lost.
Relay version directories on hosts were already never reclaimed after #27214 (nothing called the relay GC). That is accepted until the ≤1.4.223 upgrade window closes and is recorded in the relay-retire notes; this PR adds no sweep.
Linked Issue
N/A — internal Phase 3.99 cleanup (PR 2.2).
Visual Proof
N/A — no UI or behaviour change.
Testing
Dead-code proof: every removed symbol has zero references across
src,config,tests,mobile(including the@ts-nocheckfiles) apart from comments, andbuild:electron-vite,build:cliandbuild:orcadall succeed.pnpm tc,oxlint,pnpm run check:code-quality:changed(0 new findings) pass.Focused tests (all pass): remote-versioned-install, remote-install-gc-termination, orcad-remote-gc, orcad-remote-windows-decommission, orcad-managed-version-gc, remote-node-runtime-store-gc, ssh-host-relay-endpoint-census, ssh-host-relay-windows-census, orcad-migration-terminal-gate-host-wide, ssh-relay-endpoint-incumbent (+shell integration), ssh-remote-commands, ssh-known-hosts-source, ssh-host-key-decision, sftp-stream-late-error, ssh-remote-node-toolchain-probe, ssh-retained-payload-admission, ssh-managed-server-state-effects, windows-breakaway-launcher, remote-install-model, and the orcad deploy/lifecycle tests that mock the renamed module.
ssh-relay-incumbent-processonly lost one assertion; its two wall-clock cases went over their 10s bound locally at load average ~80 and are left to CI.Reliability gates: the renamed test file is updated, the deleted relay install-namespace test is removed from the staged-upload gate, and the watcher gate's completeness assertion now names the model artifacts.
Review
P0/P1 review: own review plus an independent reviewer.
Agent skill upstream boundary
Notes
SSH: the execution boundary is unchanged — the census still reads
unverifiablefor anything it cannot prove, and nothing new stops or deletes anything on a host. Windows/WSL: the WSL relay bundle and the census's Windows connect command are kept. Wire: only the receive side drops an optional field no one read.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)