Repository navigation
refactor(orcad): deploy and serve orcad through a host transport interface - #27686
Conversation
The orcad deploy, activation, serving and lifecycle code took the concrete SshConnection class. It now takes OrcadHostTransport: exactly the connection members that code and the shared install/lock/GC/host-probe helpers it calls use (exec, usesSystemSshTransport, getConnectGeneration, sftp, writeFile, uploadDirectory, getTarget). The shared helpers narrow to the same surface (RemoteInstallTransport). SshConnection implements it as is; the SSH adapter returns the connection itself so identity-keyed caches and ownership checks are unchanged. The managed tunnel (port forward, stdio bridge provider, connection manager ownership) stays on SshConnection: it is the SSH reachability layer. Type-only; no runtime, wire or persisted-format change.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No merge-blocking risk is identified; SSH workspace behavior is expected to remain unchanged. Pre-merge checks |
|
Stack: 1/2 → #27689
ELI5
The code that installs and runs Orca's remote helper (
orcad) on another machine used to require an SSH connection object specifically. It now asks for a small interface describing only what it actually uses. Today the SSH connection is the only thing that fills that interface, so nothing behaves differently.What Changed
orcadexactly as before.OrcadHostTransport(src/main/ssh/orcad-host-transport.ts) andRemoteInstallTransport(src/main/ssh/remote-install-transport.ts) types list the members that orcad deploy/activation/serve/lifecycle code and the shared install, lock, GC and host-probe helpers call:exec,usesSystemSshTransport,getConnectGeneration,sftp,writeFile,uploadDirectory,getTarget.SshConnectionto these interfaces.SshConnectionsatisfies them unchanged.sshOrcadHostTransport(conn)adapts a connection by returning the connection itself.No RPC, wire-protocol or persisted-format change. Type-only.
Why
Prepares orcad to be deployed to hosts reached without SSH (for example, a WSL distro reached via a
wsl.exestdio channel) while keeping SSH behavior byte-for-byte the same. Narrowing to an interface is less risky than wrapping the connection in a new object: several caches and ownership checks key on connection identity, and a wrapper would silently break them.Linked Issue
None — preparatory refactor.
Visual Proof
N/A — no behavior change (type-only refactor).
Testing
pnpm tc— passpnpm test src/main/ssh src/main/orcad src/main/ipc src/main/skills src/main/ai-vault src/main/wsl— 1089 files / 11022 tests passedoxlinton changed files — cleanpnpm run check:code-quality:changed— passedI manually tested these changes locally
Automated tests added/updated, or explained why not below — existing tests cover the narrowed call sites; no runtime change to test.
AI Disclosure
Review
Start with
orcad-ssh-host-transport.ts: the adapter returns the sameSshConnectioninstance, so identity-keyed caches (remote context, wake dedupe) and tunnel ownership checks see the same object as before. Everything else is signature narrowing.Agent skill upstream boundary
Notes
Security, cross-platform, SSH, mobile, backwards compatibility and performance: unaffected (no runtime change).
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)