Repository navigation
feat(ssh): relay runtime fallback ladder, telemetry and host runtime setting - #24133
Conversation
|
| const resetsRuntime = | ||
| changed('remoteRuntime') || changed('host') || changed('port') || changed('configHost') | ||
| const updated = this.store.updateSshTarget( | ||
| id, | ||
| resetsRuntime ? { ...updates, remoteRuntimeResolution: undefined } : updates |
There was a problem hiding this comment.
Config imports retain stale decisions
When a config-managed SSH host changes its HostName or port during import, the import updates the underlying store directly and bypasses this cache reset. If the new endpoint has the same glibc version, Orca can replay a refusal from the old host and skip its pinned Node on the new one. Config imports need the same decision invalidation as manual endpoint edits.
| const updated = this.store.updateSshTarget( | ||
| id, | ||
| resetsRuntime ? { ...updates, remoteRuntimeResolution: undefined } : updates |
There was a problem hiding this comment.
Endpoint edits retain memory refusals
This clears the stored decision but leaves the in-memory pinned-Node refusal, which is keyed by target ID and runtime hash rather than endpoint. If a target is edited to point to another host in the same app session, Orca checks that old refusal first and can skip rung A even when the new host supports it. Clear the in-memory refusal when the endpoint changes.
| if (reportedHosts.has(hostKey)) { | ||
| return | ||
| } | ||
| reportedHosts.add(hostKey) | ||
| try { | ||
| // track() applies the existing consent gate and validates against the strict schema. | ||
| track('ssh_remote_runtime_resolved', sshRemoteRuntimeResolvedProps(input)) |
There was a problem hiding this comment.
Rejected events consume the quota
The host is marked as reported before track() says whether it accepted the event. If a user connects while telemetry consent is disabled and enables it later in the same app session, the later connect is deduplicated, so no runtime event is sent for that host. Mark it reported only after track() succeeds.
Comments Outside DiffThese findings could not be posted inline.
|
There was a problem hiding this comment.
ℹ️ Minor suggestions only — one inline note and one design tradeoff worth confirming.
Reviewed changes
- Ladder core —
relayRuntimeLadderandnextRelayRuntimeStepexpress the A/B/C/legacy/D descent as data; freshnoexecandC+host_node_missingshort-circuit to D, a rememberednoexeconly skips its own rung. - Per-host decision + telemetry —
RelayRuntimeLadderRunpersists the rung under a glibc/runtime-hash/Orca-major key that a passing rung C can disprove, and emitsssh_remote_runtime_resolvedonce per target per session (strict enum-only schema, host key never sent). - Rung C —
planHostNodeAddonRelayruns Orca's prebuilt N-API addons on the host's own Node (>= 18, N-API >= 8) with no npm, via the addon-only toolchain probe andresolveRemoteHostNodeForAddons; unanswered probes throw rather than reading as "no Node". - Deploy loop —
deployAndLaunchRelayInnerwalks the ladder, caches the detected platform on the run, and raisesRemoteRuntimeUnavailableErrorat D;deployAndLaunchRelayOnRuntimeskipsensurePinnedRelayRuntimefor host-node-addons. - Settings + persistence — a Runtime select (Auto / Orca-managed Node / Host Node), save/draft plumbing,
remoteRuntimeResolutionnormalization, and a clear-on-endpoint/runtime change inupdateTarget. - Docs —
telemetry.mdxdocuments the new event.
ℹ️ A persisted noexec re-runs rung C (plan + full upload + failing self-test) on every reconnect
On the first connect to a noexec home, a fresh rung A refusal short-circuits straight to D. Once that refusal is persisted, later connects treat it as remembered and step to B and then C, so each reconnect plans C, uploads the relay, and self-tests it only to fail the same way; a refused C install is abandoned without the completion sentinel, so nothing is reused next time. That is the deliberate "re-prove, the mount may have changed" rule, but on a permanently noexec host it is a per-connect cost — worth confirming it is the intended trade.
Technical details
# Remembered noexec pays a full rung C attempt per connect
## Affected sites
- src/main/ssh/ssh-relay-runtime-ladder.ts:63 — `!remembered` is what sends a fresh noexec to D while a remembered one advances to B
- src/main/ssh/ssh-relay-runtime-resolution.ts:105 — only a passing rung C clears the remembered noexec (and only with a self-test, not a warm launch)
- src/main/ssh/ssh-relay-deploy.ts:499 — rung C plans the host-node-addons relay, then `deployAndLaunchRelayOnRuntime` uploads + verifies it
- src/main/ssh/ssh-relay-versioned-install.ts:179 — a refused C install is abandoned without the completion sentinel, so the next connect re-uploads
## Required outcome
Decide whether a persistently noexec host should retry C on every connect (current behaviour) or whether the remembered refusal should settle to D after one failed re-proof, and make the choice explicit.
## Open questions for the human
Is one rung C upload + self-test per reconnect acceptable on a host whose home is permanently noexec?DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
| // Why: a new runtime choice or endpoint must re-run the ladder, not replay the old rung. | ||
| const changed = (key: 'remoteRuntime' | 'host' | 'port' | 'configHost'): boolean => | ||
| key in updates && existing?.[key] !== updates[key] | ||
| const resetsRuntime = |
There was a problem hiding this comment.
This reset only runs through SshConnectionStore.updateTarget, but passive ~/.ssh/config sync (importFromSshConfig) rewrites host/port straight through store.updateSshTarget, so a repointed config alias keeps its cached remoteRuntimeResolution. Because the cache key is glibc + pinned-runtime hash + Orca major and not the endpoint, a host that moved to a machine which would qualify for rung A keeps skipping it.
Technical details
# Config-sync endpoint change does not clear the cached ladder decision
## Affected sites
- src/main/ssh/ssh-connection-store.ts:92 — `resetsRuntime` only guards `updateTarget`
- src/main/ssh/ssh-connection-store.ts:224 — `importFromSshConfig` calls `store.updateSshTarget(existing.id, { ...nextFields, source: 'ssh-config' })` directly, bypassing the reset
## Required outcome
An endpoint change to a config-sourced target must clear `remoteRuntimeResolution` the same way a renderer edit does, so the ladder re-runs against the new endpoint.
## Suggested approach
Route the sync write through `updateTarget` (note it also reclaims the alias), or clear the field inside `importFromSshConfig` when `host`/`port` differ.There was a problem hiding this comment.
✅ No new issues found in the incremental delta.
Reviewed changes
- Test-only cleanup (
1b7e39a) —readdirSyncis folded into the existingnode:fsimport inssh-relay-host-node-addons.test.tsand its duplicate import removed. No production or behavioral change.
The two prior notes from the initial review (the config-sync cached-decision gap inline, and the per-reconnect rung C cost at D) are unaffected by this commit and remain open.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
876e541 to
b111d20
Compare
…t, C, D) Rung C runs the relay on the host's Node >= 18 with Orca's prebuilt N-API addons and no npm (addon-only probe mode). Rung B is a data-driven slot chosen only when a compat runtime is listed. Rung D fails the connect with a classified reason carried as a TerminalUnavailableCause. The ladder steps down only on classified refusals; unanswered probes throw. The rung decision is persisted per host keyed by (glibc, runtime hash, Orca major), and ssh_remote_runtime_resolved reports it once per host per session.
…ibc-less compat runtimes A remembered rung A noexec was re-persisted even after rung C self-tested addons from the same ~/.orca-remote tree, so rung A stayed skipped until the key changed. Rung B's evaluator also could never match a musl compat runtime.
1b7e39a to
f6ff3df
Compare
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)📝 WalkthroughWalkthroughThe SSH settings now support Auto, pinned Node, and legacy runtime choices. Relay deployment uses a runtime ladder that can plan with pinned Node or host Node, persist decisions, and report unavailable-runtime outcomes. Host-Node planning checks Node and N-API requirements and stages addons. The changes also add transfer and self-test tracking, strict SSH runtime telemetry, and persistence validation for runtime choices and resolution data. Priority: ➖ Normal Merge Risk: 🟡 Moderate · up to Resolve stale runtime decisions after SSH config changes before merging. Also preserve the structured unavailable-runtime outcome when the final fallback fails. Runtime telemetry can be lost after a rejected capture, although its intended retry behavior remains unclear. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Runtime verification and bounded, consent-gated telemetry provide useful controls. However, SSH configuration imports can carry a saved runtime refusal to a different endpoint, causing future connections to skip the managed runtime without checking it on that host. 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)
Full details: Docstring CoverageExplanation Docstring coverage is 30.59% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 85 functions across 41 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: a582048d-8d68-416f-be0c-0dcc0448e365
📒 Files selected for processing (43)
config/scripts/orcad-prebuild-slot-contents.test.mjsdocs/site/content/docs/telemetry.mdxsrc/main/ipc/ssh-target-crud-handlers.tssrc/main/ipc/telemetry.tssrc/main/persistence-ssh-targets-and-pane-keys.test.tssrc/main/persistence/leasing-ssh-ptys/ssh-normalization.tssrc/main/ssh/orcad-remote-node-runtime.tssrc/main/ssh/ssh-connection-store.test.tssrc/main/ssh/ssh-connection-store.tssrc/main/ssh/ssh-relay-deploy-pinned-node.test.tssrc/main/ssh/ssh-relay-deploy.tssrc/main/ssh/ssh-relay-host-node-addons.test.tssrc/main/ssh/ssh-relay-host-node-addons.tssrc/main/ssh/ssh-relay-opencode-pinned-node.test.tssrc/main/ssh/ssh-relay-opencode-pinned-node.tssrc/main/ssh/ssh-relay-pinned-node-install.test.tssrc/main/ssh/ssh-relay-pinned-node-install.tssrc/main/ssh/ssh-relay-pinned-node.test.tssrc/main/ssh/ssh-relay-pinned-node.tssrc/main/ssh/ssh-relay-runtime-ladder.test.tssrc/main/ssh/ssh-relay-runtime-ladder.tssrc/main/ssh/ssh-relay-runtime-resolution.test.tssrc/main/ssh/ssh-relay-runtime-resolution.tssrc/main/ssh/ssh-relay-runtime-self-test.tssrc/main/ssh/ssh-relay-runtime-step-plan.tssrc/main/ssh/ssh-remote-node-addon-resolution.test.tssrc/main/ssh/ssh-remote-node-addon-resolution.tssrc/main/ssh/ssh-remote-node-resolution.tssrc/main/ssh/ssh-remote-node-toolchain-probe.test.tssrc/main/ssh/ssh-remote-node-toolchain-probe.tssrc/main/ssh/ssh-remote-runtime-telemetry.test.tssrc/main/ssh/ssh-remote-runtime-telemetry.tssrc/renderer/src/components/settings/SshHostAdvancedFields.tsxsrc/renderer/src/components/settings/ssh-target-draft.test.tssrc/renderer/src/components/settings/ssh-target-draft.tssrc/renderer/src/components/settings/ssh-target-save-payload.test.tssrc/renderer/src/components/settings/ssh-target-save-payload.tssrc/renderer/src/components/sidebar/add-remote-host-ssh-actions.tssrc/renderer/src/i18n/locales/en.jsonsrc/shared/orcad-artifacts.tssrc/shared/ssh-types.tssrc/shared/telemetry-event-registry.tssrc/shared/telemetry-ssh-runtime-event-schemas.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.
| { step, run } | ||
| ) | ||
| // Why only a laddered pass: a plain host-npm connect has no rung decision to record. | ||
| if (ladder.length > 1) { | ||
| run.settle(step) | ||
| } | ||
| return result | ||
| } catch (err) { | ||
| if (err instanceof PinnedRelayFallbackError) { | ||
| logPinnedRelayFallback(err.reason, err.detail) | ||
| runtime = 'legacy' | ||
| if (err instanceof PinnedRelayFallbackError && step !== 'legacy' && step !== 'D') { | ||
| console.warn( | ||
| `[ssh-relay] Relay runtime rung ${step} unavailable (${err.reason}): ${err.detail}` | ||
| ) | ||
| run.refused(step, err.reason) | ||
| step = nextRelayRuntimeStep(ladder, step, err.reason, err.remembered) | ||
| run.enter(step) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
sed -n '410,462p' src/main/ssh/ssh-relay-deploy.ts
sed -n '540,620p' src/main/ssh/ssh-relay-deploy.ts
rg -n 'resolveRelayBootstrapState|host_node_missing|RemoteRuntimeUnavailableError' src/main/sshRepository: stablyai/orca
Length of output: 6958
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- changed files/stat ---'
git diff --stat a5601375d44cc245e5bc5c3bbdb1d1c48f28e5c6 f6ff3df6590e693ca3ebafdc883756df9f058535
printf '%s\n' '--- runtime ladder ---'
cat -n src/main/ssh/ssh-relay-runtime-ladder.ts
printf '%s\n' '--- bootstrap resolver ---'
sed -n '280,395p' src/main/ssh/ssh-relay-deploy.ts | cat -n
printf '%s\n' '--- host-node addon resolver ---'
cat -n src/main/ssh/ssh-relay-host-node-addons.ts
printf '%s\n' '--- runtime resolution errors ---'
sed -n '120,205p' src/main/ssh/ssh-relay-runtime-resolution.ts | cat -n
printf '%s\n' '--- pinned-node deploy tests around unavailable runtime ---'
sed -n '350,430p' src/main/ssh/ssh-relay-deploy-pinned-node.test.ts | cat -n
printf '%s\n' '--- relevant catch/error usages ---'
rg -n -C 4 'RemoteRuntimeUnavailableError|PinnedRelayFallbackError|resolveRelayBootstrapState|host_node_missing|no_runtime|deployAndLaunchRelay' src/main/ssh --glob '*.{ts,d.ts}'Repository: stablyai/orca
Length of output: 45665
🤖 get_repo_knowledge executed:
get_repo_knowledge stablyai/orca /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/architecture /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/learnings /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4/conventions
Length of output: 47850
🏁 Script executed:
#!/bin/bash
set -e
git diff --stat a5601375d44cc245e5bc5c3bbdb1d1c48f28e5c6 f6ff3df6590e693ca3ebafdc883756df9f058535
cat -n src/main/ssh/ssh-relay-runtime-ladder.ts
sed -n '280,395p' src/main/ssh/ssh-relay-deploy.ts | cat -n
cat -n src/main/ssh/ssh-relay-host-node-addons.ts
sed -n '120,205p' src/main/ssh/ssh-relay-runtime-resolution.ts | cat -n
sed -n '350,430p' src/main/ssh/ssh-relay-deploy-pinned-node.test.ts | cat -n
rg -n -C 4 'RemoteRuntimeUnavailableError|PinnedRelayFallbackError|resolveRelayBootstrapState|host_node_missing|no_runtime|deployAndLaunchRelay' src/main/ssh --glob '*.{ts,d.ts}'Repository: stablyai/orca
Length of output: 45665
🏁 Script executed:
git diff --stat a5601375d44cc245e5bc5c3bbdb1d1c48f28e5c6 f6ff3df6590e693ca3ebafdc883756df9f058535
cat -n src/main/ssh/ssh-relay-runtime-ladder.ts
sed -n '280,395p' src/main/ssh/ssh-relay-deploy.ts | cat -n
cat -n src/main/ssh/ssh-relay-host-node-addons.ts
sed -n '120,205p' src/main/ssh/ssh-relay-runtime-resolution.ts | cat -n
sed -n '350,430p' src/main/ssh/ssh-relay-deploy-pinned-node.test.ts | cat -n
rg -n -C 4 'RemoteRuntimeUnavailableError|PinnedRelayFallbackError|resolveRelayBootstrapState|host_node_missing|no_runtime|deployAndLaunchRelay' src/main/ssh --glob '*.{ts,d.ts}'Repository: stablyai/orca
Length of output: 45665
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- remote node resolution ---'
cat -n src/main/ssh/ssh-remote-node-resolution.ts
printf '%s\n' '--- pinned runtime error declarations ---'
rg -n -C 8 'class PinnedRelayFallbackError|type RelayRuntimeFallbackReason|host_node_missing|resolveRemoteNodePath' src/main/ssh/ssh-relay-pinned-node.ts src/main/ssh/ssh-remote-node-resolution.ts src/main/ssh/ssh-remote-node-addon-resolution.ts
printf '%s\n' '--- deploy imports/entrypoints/planning ---'
sed -n '1,150p' src/main/ssh/ssh-relay-deploy.ts | cat -n
sed -n '150,285p' src/main/ssh/ssh-relay-deploy.ts | cat -n
printf '%s\n' '--- relay runtime resolution beginning and ladder state ---'
sed -n '1,140p' src/main/ssh/ssh-relay-runtime-resolution.ts | cat -n
printf '%s\n' '--- focused deploy tests 236-470 ---'
sed -n '236,470p' src/main/ssh/ssh-relay-deploy-pinned-node.test.ts | cat -n
printf '%s\n' '--- session handling of deployment errors ---'
rg -n -C 6 'deployAndLaunchRelay\\(|RemoteRuntimeUnavailableError|terminalUnavailableCauseFromError|TerminalUnavailableCause|status: .blocked' src/main/ssh src/main/ipc src/shared --glob '*.{ts,d.ts}' --glob '!*.test.ts'Repository: stablyai/orca
Length of output: 41868
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- remote node resolution ---'
cat -n src/main/ssh/ssh-remote-node-resolution.ts
printf '%s\n' '--- pinned runtime error declarations ---'
rg -n -C 8 'class PinnedRelayFallbackError|type RelayRuntimeFallbackReason|host_node_missing|resolveRemoteNodePath' src/main/ssh/ssh-relay-pinned-node.ts src/main/ssh/ssh-remote-node-resolution.ts src/main/ssh/ssh-remote-node-addon-resolution.ts
printf '%s\n' '--- deploy imports/entrypoints/planning ---'
sed -n '1,150p' src/main/ssh/ssh-relay-deploy.ts | cat -n
sed -n '150,285p' src/main/ssh/ssh-relay-deploy.ts | cat -n
printf '%s\n' '--- relay runtime resolution beginning and ladder state ---'
sed -n '1,140p' src/main/ssh/ssh-relay-runtime-resolution.ts | cat -n
printf '%s\n' '--- focused deploy tests 236-470 ---'
sed -n '236,470p' src/main/ssh/ssh-relay-deploy-pinned-node.test.ts | cat -n
printf '%s\n' '--- session handling of deployment errors ---'
rg -n -C 6 'deployAndLaunchRelay\(|RemoteRuntimeUnavailableError|terminalUnavailableCauseFromError|TerminalUnavailableCause|status: .blocked' src/main/ssh src/main/ipc src/shared --glob '*.{ts,d.ts}' --glob '!*.test.ts'Repository: stablyai/orca
Length of output: 42680
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- runtime step planner ---'
cat -n src/main/ssh/ssh-relay-runtime-step-plan.ts
printf '%s\n' '--- deploy inner ladder and attempt call ---'
sed -n '420,470p' src/main/ssh/ssh-relay-deploy.ts | cat -n
sed -n '500,590p' src/main/ssh/ssh-relay-deploy.ts | cat -n
printf '%s\n' '--- session establish/reconnect error boundaries ---'
sed -n '500,590p' src/main/ssh/ssh-relay-session.ts | cat -n
sed -n '680,750p' src/main/ssh/ssh-relay-session.ts | cat -n
sed -n '1010,1105p' src/main/ssh/ssh-relay-session.ts | cat -n
printf '%s\n' '--- cause use and relay deployment catch references ---'
rg -n -F -C 5 'terminalUnavailableCauseFromError' src/main/ssh src/main/ipc src/shared --glob '*.{ts,d.ts}' --glob '!*.test.ts'
rg -n -F -C 5 'deployAndLaunchRelay(conn' src/main/ssh/ssh-relay-session.tsRepository: stablyai/orca
Length of output: 23437
Classify a conclusive legacy no-runtime result as rung D.
When rung C refuses for a classified reason such as libc_floor, the loop enters legacy. The legacy plan has no prebuilt runtime, so resolveRemoteBootstrapState calls resolveRemoteNodePath. If no usable Node/npm exists, that resolver throws a plain Error. The ladder catch rethrows it because it handles only PinnedRelayFallbackError. The loop therefore never reaches D.
This exposes a generic installation error instead of RemoteRuntimeUnavailableError with a structured blocked cause. Classify only the resolver's conclusive no-runtime error. Preserve unanswered SSH probe errors on the current abort path.
Suggested fix
diff --git a/src/main/ssh/ssh-remote-node-resolution.ts b/src/main/ssh/ssh-remote-node-resolution.ts
@@
const LOGIN_SHELL_PROBE_TIMEOUT_MS = 8_000
+export class RemoteNodeNotFoundError extends Error {
+ constructor(message: string) {
+ super(message)
+ this.name = 'RemoteNodeNotFoundError'
+ }
+}
+
@@
- throw new Error(guidance)
+ throw new RemoteNodeNotFoundError(guidance)
@@
- throw new Error(
+ throw new RemoteNodeNotFoundError(
[
'Node.js not found on remote host. Orca relay requires Node.js 18+ and npm.',diff --git a/src/main/ssh/ssh-relay-deploy.ts b/src/main/ssh/ssh-relay-deploy.ts
@@
-import { resolveRemoteNodePath } from './ssh-remote-node-resolution'
+import {
+ RemoteNodeNotFoundError,
+ resolveRemoteNodePath
+} from './ssh-remote-node-resolution'
@@
} catch (err) {
+ if (ladder.length > 1 && step === 'legacy' && err instanceof RemoteNodeNotFoundError) {
+ run.refused(step, 'host_node_missing')
+ step = 'D'
+ run.enter(step)
+ continue
+ }
if (err instanceof PinnedRelayFallbackError && step !== 'legacy' && step !== 'D') {| if (reportedHosts.has(hostKey)) { | ||
| return | ||
| } | ||
| reportedHosts.add(hostKey) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Dedupe marks the host as reported before track can succeed.
The host key is added to reportedHosts before track() runs. track() returns false when the user has not yet consented, the client is not initialized, or the burst cap is hit. In those cases the host is never reported again in this session. If consent is granted later, the event is lost for that host.
Consider adding the key only when track() returns true. This keeps the once-per-session guarantee for emitted events and avoids losing events to transient gates. If you prefer to drop events that occur before consent, document that choice.
Proposed fix
if (reportedHosts.has(hostKey)) {
return
}
- reportedHosts.add(hostKey)
try {
// track() applies the existing consent gate and validates against the strict schema.
- track('ssh_remote_runtime_resolved', sshRemoteRuntimeResolvedProps(input))
+ if (track('ssh_remote_runtime_resolved', sshRemoteRuntimeResolvedProps(input))) {
+ reportedHosts.add(hostKey)
+ }
} catch {The test at ssh-remote-runtime-telemetry.test.ts mocks track with vi.fn(), which returns undefined. Make the mock return true so the dedupe test still passes.
| reason: RelayRuntimeStepReason, | ||
| remembered = false | ||
| ): RelayRuntimeStep { | ||
| if ((reason === 'noexec' && !remembered) || (current === 'C' && reason === 'host_node_missing')) { |
There was a problem hiding this comment.
Permission refusal skips fallbacks
If only the pinned executable is blocked, its exit 126 or “Permission denied” response is still classified as noexec. This branch then jumps straight to D without trying Host Node or npm. A host with a usable runtime can lose its SSH connection and receive an incorrect home-directory noexec diagnosis.
| // Why only a laddered pass: a plain host-npm connect has no rung decision to record. | ||
| if (ladder.length > 1) { | ||
| run.settle(step) | ||
| } |
There was a problem hiding this comment.
Default runtime goes unreported
The default Host Node runtime has a one-step ladder, so this condition never calls settle() for those connections. As a result, they emit no ssh_remote_runtime_resolved event, leaving the documented once-per-host telemetry incomplete and undercounting hosts using the legacy runtime.

ELI5
When Orca's pinned Node can't run on an SSH host, Orca now tries the next option instead of failing. First Orca's pinned Node, then (later) an old-glibc build, then the host's own Node with Orca's prebuilt addons, then today's npm path. If nothing works, the connection fails with a clear reason. A new per-host setting chooses the runtime.
What Changed
Ladder (
ssh-relay-runtime-ladder.ts), used when the runtime is "Orca-managed Node":RemoteRuntimeUnavailableErrorwhose message andTerminalUnavailableCausestate the reason.It steps down only on a classified refusal. Anything unverifiable fails the connect, and the next connect retries the same rung.
Persisted decision:
SshTarget.remoteRuntimeResolutionrecords the result. A rung A refusal is reused only while the glibc version, runtime hash and Orca major version still match. It resets when the host, port or runtime setting changes.Telemetry:
ssh_remote_runtime_resolved, enum fields only, behind the existing consent gate. It's sent once per host per session, and the host key is never sent.telemetry.mdxlists what it collects.Settings: SSH host → Advanced → Runtime, with Auto, Orca-managed Node and Host Node. Auto keeps today's default.
Why
This is design D6: nobody who connects today should be locked out, and a noexec home or policy refusal should produce a stated reason instead of a silent failure.
Linked Issue
Part of the Node runtime plan (Phase 2). Stacked on #24129.
Visual Proof
Captured from the e2e build in the background (
ORCA_BACKGROUND_LAUNCH=1, headless, isolated profile). A seeded SSH host is open at Settings → SSH Hosts → Edit target → Advanced.Before (base branch): Advanced has no Runtime setting.
After: Advanced shows a Runtime select with help text. It defaults to Auto.
After, select open: Auto, Orca-managed Node, Host Node.
Testing
Tests: 14,285 tests pass across
src/main/ssh, settings, shared and prebuild. They cover each rung, the noexec → D path, descent from A through B and C to legacy, the persisted refusal and key mismatch, and telemetry sent once.Fixed in review: a remembered noexec is now cleared once rung C passes, and rung B can match musl hosts.
Not done:
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.