Repository navigation
feat(ssh): opt-in SSH relay on the pinned Node with prebuilt addons - #24129
Conversation
|
| if (remoteRuntime === 'pinned-node') { | ||
| normalized.remoteRuntime = remoteRuntime | ||
| } |
There was a problem hiding this comment.
Explicit legacy setting is lost
When ORCA_SSH_REMOTE_RUNTIME=pinned-node is set, normalization removes a host's explicit remoteRuntime: 'legacy' setting. Runtime selection then sees no host setting and uses pinned Node, despite that host being configured to stay on the legacy path.
| if (remoteRuntime === 'pinned-node') { | |
| normalized.remoteRuntime = remoteRuntime | |
| } | |
| if (remoteRuntime === 'pinned-node' || remoteRuntime === 'legacy') { | |
| normalized.remoteRuntime = remoteRuntime | |
| } |
Comments Outside DiffThese findings could not be posted inline.
|
There was a problem hiding this comment.
ℹ️ No critical issues — one test-coverage suggestion inline.
Reviewed changes
This run reviewed the full stacked feature: the per-host opt-in that runs the SSH relay on Orca's pinned Node with prebuilt addons, plus the relay-side runtime self-test and handshake field it depends on.
- Per-host runtime setting —
SshTarget.remoteRuntime(legacydefault,pinned-nodeopt-in) with theORCA_SSH_REMOTE_RUNTIMEdev override; only the opt-in value survives normalization so an unknown newer value can't change the runtime. - Target facts —
resolveOrcadDeploymentTargetFactsnow returns the host's glibcmajor.minorbeside the server target, parsed byparseGlibcVersionfrom either probe. - Pinned plan — stages this target's prebuilt
node-pty/@parcel/watcherfrom the verified orcad slot, folds the runtime sha and addon digest into the relay version (so pinned and host-Node builds never share a dir or socket), and points the launch at the sharedruntimes/node-<sha>store. - Pinned install + self-test —
ensurePinnedRelayRuntime(cheap.verifiedwarm path, full verify cold) andverifyPinnedRelayInstallrunnode --versionthenrelay.js --orca-runtime-selftest <nonce>, withpassed/refused/unverifiable/failedverdicts: classified refusals fall back, timeouts and lost channels never do, and the promote command now preserves the loader's exit status/output for classification. - Fallback + handshake —
PinnedRelayFallbackErrorretries on the host-Node path, staged addons are disposed infinally, and handshake-ok gains an optional informationalruntime: {kind, version}.
I verified the fallback lifecycle and version/socket differentiation against the source: a refusal thrown inside the install lock is caught by the existing handler (abandonInstall + ownsInstallLock = false), so the legacy retry cannot land in the pinned dir or leave a finalized-but-broken one. The wire change is an optional field, so it stays compatible under the remote wire rules.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| ).toBe(false) | ||
| }) | ||
|
|
||
| it('falls back to the host-Node relay on a classified refusal', async () => { |
There was a problem hiding this comment.
This is the only fallback case, and it fires before any lock is taken (ensurePinnedRelayRuntime runs at ssh-relay-deploy.ts:530). The refusal that is thrown while the install lock is held — verifyPinnedRelayInstall at ssh-relay-deploy.ts:647 — and the lock-release/abandon ordering that follows are therefore reasoned but not asserted. Consider a second case here with isRelayAlreadyInstalled mocked false and verifyPinnedRelayInstall rejecting a PinnedRelayFallbackError.
Technical details
# In-lock fallback path is untested
## Affected sites
- `src/main/ssh/ssh-relay-deploy-pinned-node.test.ts:220` — mocks `ensurePinnedRelayRuntime` (pre-lock) and leaves `isRelayAlreadyInstalled` mocked `true`, so the locked branch never runs.
- `src/main/ssh/ssh-relay-deploy.ts:645-677` — `verifyPinnedRelayInstall` refusal is caught by the lock `catch` (`abandonInstall`, `ownsInstallLock = false`, rethrow), which the suite does not exercise.
## Required outcome
A case where the pinned dir is not yet installed and the pre-`finalize` self-test refuses, asserting the deploy retries on the host-Node relay and the partial pinned dir is abandoned rather than finalized.63b6517 to
876e541
Compare
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between 876e54114f4e9c593435e49b9a1ce42a5d899ccb and 3074229. 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe change adds an opt-in pinned Node runtime for SSH relays. It selects supported hosts, stages required addons, installs and verifies the runtime, and falls back to host Node for classified refusals. Relay self-tests report runtime identity and check native binding loading and PTY execution. Successful handshakes can include the runtime kind and version. SSH target persistence retains Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established. The pinned runtime remains opt-in and legacy remains the default. Real Linux SSH end-to-end validation is still outstanding, but that alone does not demonstrate a failure. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The opt-in rollout preserves existing connection credentials and does not switch runtimes after uncertain verification. No privilege expansion was established, but cached executable integrity and the shared runtime’s lifecycle remain only partially verified. Retained concerns Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
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 |
…shake-ok
relay.js --orca-runtime-selftest <nonce> dlopens pty.node, opens and closes a
PTY, and prints one JSON line (nonce, node, napi, glibcVersionRuntime) for the
client to classify before it launches a daemon on a runtime (design D5).
handshake-ok gains an optional runtime {kind, version}; bridge and daemon
already match exactly on version, so it is informational only (D8.1).
… A, D8.1) SshTarget.remoteRuntime (legacy | pinned-node, default legacy; env ORCA_SSH_REMOTE_RUNTIME for development) selects the runtime. On POSIX hosts the pinned path resolves the target with its glibc major.minor, ensures ~/.orca-remote/runtimes/node-<sha>/bin/node, uploads the relay bundle plus the target's node-pty slot and @parcel/watcher from the orcad artifact (no npm or node-gyp on the host), writes .runtime-ref-node-<sha>, and folds the runtime and addon digests into the relay version so pinned and host-Node builds never share a dir or socket. A 30 s self-test (node --version, then the relay self-test) gates .install-complete. Timeouts and lost channels are unverifiable and never step down; noexec, missing_lib, libc_floor, illegal_instruction and wrong_libc refusals fall back to the untouched host-Node path with a logged reason, remembered for the session.
A lost channel during target detection says nothing about the host; descending would launch a host-Node daemon beside a running pinned one and strand its sessions.
876e541 to
b111d20
Compare

ELI5
The SSH relay can now run on Orca's pinned Node with node-pty prebuilt by Orca, so a host needs no Node, npm or compiler. It's opt-in per host (
remoteRuntime: "pinned-node"); the current path stays the default.What Changed
SshTarget.remoteRuntimeislegacy(default) orpinned-node.ORCA_SSH_REMOTE_RUNTIME=pinned-nodeturns it on for development. There's no settings UI yet.resolveOrcadDeploymentTargetFactsreturns the target plus the glibcmajor.minor.@parcel/watcherfrom the verified orcad artifact, plus.runtime-ref-node-<sha>.ensureRemoteOrcadNodeRuntimeand launches the relay withruntimes/node-<sha>/bin/node.node --version, thenrelay --orca-runtime-selftest <nonce>(loadspty.nodeand opens a PTY).unverifiable: retry, never step down.runtime: {kind, version}. That's safe under the remote wire-compatibility rules.Why
This removes on-host npm and node-gyp, the root cause of #1693, #20386, #22159 and #23554. It sits behind a setting so the team can try it on real hosts before changing the default (design D8).
Linked Issue
Part of the Node runtime plan (Phase 2). Stacked on #24110.
Visual Proof
N/A. The setting is off by default and has no UI yet.
Testing
Unit tests cover target detection, the version hash, command construction, self-test classification and fallback.
A local-host integration test runs on darwin.
The reviewer fixed one bug: a lost SSH channel during the libc probe used to fall back to legacy. It now surfaces as
unverifiable.Not done: an SSH end-to-end run against a real Linux host (no Docker here, and ssh to localhost is refused), the full fallback ladder (rungs B and C), telemetry, and Windows hosts.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.