Repository navigation
fix(ssh): say when this computer can't download Node for a managed server, and where an offline copy goes - #30911
Conversation
…rver, and where an offline copy goes
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
be17c886-3410-40b8-aeba-ad64b244e628
📒 Files selected for processing: 2
src/main/node-runtime/pinned-runtime-materializer-node.test.tssrc/main/node-runtime/pinned-runtime-materializer.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.
| const localFailure = error instanceof Error && 'code' in error && typeof error.code === 'string' | ||
| if (signal?.aborted || error instanceof ReleaseMismatchError || localFailure) { | ||
| return error |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Wrap coded network failures.
If fetcher rejects with an error whose code is ECONNREFUSED, this check returns the error unchanged. The user then gets neither the download URL nor the offline cache path. Distinguish known local filesystem errors from network errors instead of treating every string code as a local failure. The PR objective calls for wrapping network failures while preserving local filesystem errors.
ELI5
To start Orca's server on an SSH host, the Orca app on your computer downloads Node.js once and uploads it to the host. The host never downloads anything. When your computer couldn't reach nodejs.org, Orca showed only "Orca couldn't start its server on this host. Try connecting again." with the detail
net::ERR_CONNECTION_REFUSED. That points at the host, and connecting again can't help. The detail now says what actually happened and how to get past it, including without internet access.What Changed
Before: a user on an intranet saw the setup stop with the detail
net::ERR_CONNECTION_REFUSED. They concluded the remote host needed internet access to "install Orca".After: the detail reads:
Mechanism:
materializeVerifiedRuntimeArchive(src/main/node-runtime/pinned-runtime-materializer.ts) is the one place that downloads the pinned Node archive for SSH, WSL and Windows-host deploys. It now wraps a network failure in that message and keeps the original ascause. Three kinds of error pass through unchanged:ReleaseMismatchError(checksum, size or 404);code.The offline route already worked: the cache accepts any file at that path that matches the pinned SHA-256, with no download. The message just tells people about it.
Why
net::ERR_CONNECTION_REFUSEDonly comes from Electron's Chromiumnet.fetch. Checked live: Electron 43net.fetchto a closed port rejects with exactly that string, while thewsclient the desktop uses to reach orcad through the tunnel reportsconnect ECONNREFUSED 127.0.0.1:<port>. During managed-server setup, the only Chromium fetch is this Node archive download (orcad-remote-deploy.ts → installOrcadBundle → ensureRemoteOrcadNodeRuntime → archivePath()). Rejected alternatives:Linked Issue
User report from Slack/WeChat (no GitHub issue).
Visual Proof
N/A. The change is text-only, in the "Details" line under the SSH host. The new message is quoted above.
Testing
src/main/node-runtime/pinned-runtime-materializer-node.test.ts:Received: "net::ERR_CONNECTION_REFUSED";Ran single-worker:
src/main/node-runtime,src/main/wsl/wsl-pinned-runtime.test.ts,src/main/ai-vault/opencode-wsl-runtime-preparation.test.ts,src/main/managed-server/host-state,src/main/ssh/orcad-remote-deploy.test.tsandsrc/main/orcadall pass. The only failure isorcad-forked-child-paths.test.ts, the known macOS/private/vartemp-dir issue, which this change doesn't touch.Ran the static job steps locally: all pass except the VM rollback oracle, which can't resolve
zodfrom its temp baseline on this machine (unrelated).Verified live: Electron's
net.fetcherror string. Also confirmed the npmmirror.com copy ofnode-v24.21.0-linux-x64.tar.gzhas the pinned SHA-256, so a mirror download works as a drop-in.Verified only in CI (existing coverage): the
debian10-no-egresscell in ssh-hostile-hosts shows a host with no internet activates orcad, andssh-orcad-auto-convert.spec.tscovers a host withAllowTcpForwarding nousing the stdio bridge.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Codex (gpt-6.1-sol, high): no findings. Independent Opus review: see comments.
Agent skill upstream boundary
Notes
path.join.detailis already free text.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)