You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(wsl): fail a first deploy fast when the Node runtime download gets no answer - #35869
The first time Orca sets up its server inside a WSL distro, it downloads Node (about 30 MB). It tries from this computer first, then from inside the distro. On a network that silently drops traffic, that took about two minutes before giving up. Now it gives up in about 45 seconds, and the error still says exactly how to fix it.
What Changed
Desktop download (runtime-archive-download.ts, pinned-runtime-materializer.ts): new optional connectTimeoutMs.
If no response arrives within it, the attempt fails with "Node download got no response within N s".
That error is not retried: a dropped connection would only repeat the wait. Other transient errors still retry as before.
The abort normalization now keeps the actual reason (stalled or unanswered), not always "stalled".
Host fallback (remote-node-runtime-host-download.ts): the per-source connect timeout for curl --connect-timeout and wget -T is now a parameter. It defaults to the existing 20 s.
Plumbing:
deployOrcad takes an optional nodeRuntimeDownload budget, applied through a new small orcad-node-runtime-install-options.ts.
The budget flows through installOrcadBundle and ensureRemoteOrcadNodeRuntime to the host fallback.
Only the WSL deploy (wsl-orcad-deploy.ts) passes it: WSL_NODE_RUNTIME_DOWNLOAD_BUDGET = 15 s desktop, 15 s per host source.
Host fallback kept on a proxy refusal, deliberately. On win-lowspec the desktop's proxy refused the download and the distro's own route is what made the deploy succeed.
Error unchanged: the final message already names the mirror setting (Settings > Advanced > Network > Node.js download mirror, or NODEJS_ORG_MIRROR) and the offline archive path. The existing host-fallback test keeps covering that.
Why
The win-lowspec QA run (signed 1.4.244, with the test instance's desktop traffic refused by a proxy) found the pinned Node runtime is not bundled for WSL targets. The template ships only the runtime marker, so a first deploy fetches it.
Worst case on a firewall that drops packets:
Before
After
Desktop
4 attempts × about 21 s (the Windows connect timeout) + 1/3/9 s gaps ≈ 1.5–2 min
one 15 s attempt
Host fallback
20 s per source
15 s per source (official, plus mirror if set)
Total
about 2–2.5 min, then fails
≤ 45 s, then the same actionable error
Alternatives considered:
Bundling the archive: fixes it fully, at a cost in installer size. That's the next PR.
Skipping the host fallback when the desktop's proxy refuses: rejected. It would have failed the win-lowspec run, which only passed because of the fallback.
Linked Issue
Follow-up to the win-lowspec WSL host proxy QA (flag-on checklist).
Visual Proof
N/A: no UI change. It changes download timing and failure speed only.
Testing
runtime-archive-download.test.ts:
a request that never answers fails with the "no response within" error after one attempt (no retry);
a response that arrives within the budget downloads in full.
remote-node-runtime-host-download.test.ts: a real sh run of the generated command with fake curl and wget records --connect-timeout / -T. It shows 20 by default (SSH) and 15 when a WSL budget is passed.
orcad-node-runtime-install-options.test.ts:
SSH gets no budget;
WSL threads 15 000 ms to the desktop materializer and 15 s to the host;
the worst case stays ≤ 45 s.
wsl-orcad-deploy.test.ts: the WSL deploy passes the budget to deployOrcad.
Suites: node-runtime, managed-server/install, the byte budget, orcad-remote-deploy, the SSH on-connect node download, wsl-orcad-deploy and orcad-runtime-deployment all pass (806).
Checks:pnpm tc, pnpm run typecheck:ci, pnpm run check:code-quality:changed, oxlint, the anti-slop oxlint (plugin synced) and both ast-grep steps pass.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Two reviewers requested: e9-reviewer and fix-reviewer-2.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
User-risk:
Slow servers: a WSL first deploy whose desktop download gets no response in 15 s now goes straight to the distro's own download instead of retrying from this computer. A very slow but working proxy that takes over 15 s to start responding would use the distro route.
Unchanged: once a response starts, the existing 120 s stall guard and full-size download apply.
Flag-off: only the WSL deploy passes the budget. SSH and every other caller keep today's timing (the defaults are unchanged and test-covered).
SSH: unaffected. This touches shared install code, but only through a new optional parameter that SSH doesn't pass.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
…s no answer
A first WSL deploy fetches the pinned Node archive, from this computer
and then from inside the distro. Behind a firewall that drops packets it
retried four times and then waited 20 s per host source, about two
minutes before failing. WSL deploys now give the desktop one 15 s attempt
with no retry on a missing response, and the host 15 s per source, so a
dead network fails in about 45 s. The host fallback stays, since the
distro's own route often succeeds when this computer's proxy refuses.
SSH keeps its timing.
The reason will be displayed to describe this comment to others. Learn more.
Worst-case test misses a download
With a mirror configured, withNodeDistMirror waits up to 15 seconds for the mirror, then another 15 seconds for the official URL. The host then tries both sources, adding up to 30 seconds. A dropped network can therefore take about 60 seconds, while this test passes by counting only one desktop source.
Exercise the mirror fallback path and either share the desktop deadline across sources or correct the claimed bound.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The change adds configurable connection timeouts for desktop Node runtime archive downloads and host download fallbacks. Desktop requests that exceed the configured timeout abort without retrying. Host curl and wget commands use a configurable timeout, with a 20-second default. Deployment options pass timeout budgets through to the download paths. WSL deployments set both connection timeouts to 15 seconds.
Priority: Normal
Merge Risk: Moderate · up to 6fab8
First-time WSL deployment can still wait far longer than intended on a silent download source. Fix the curl idle limit and shared desktop budget before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: making the first WSL deploy fail faster when the Node runtime download receives no response.
Description check
The description is mostly complete. It explains the user impact, implementation, rationale, alternatives, testing, scope, compatibility considerations, and the lack of UI changes. The linked issue is …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Description check
Explanation
The description is mostly complete. It explains the user impact, implementation, rationale, alternatives, testing, scope, compatibility considerations, and the lack of UI changes. The linked issue is not provided as an actual issue reference, and the general validation checklist remains partially unchecked, but these omissions do not make the description incomplete overall.
Full details: Docstring Coverage
Explanation
Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 12 functions across 13 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches: 💡 1
📝 Generate docstrings: 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Major · Stability & Availability · Quick win
Bound curl when a connected source sends no response.
If a host proxy completes the connection and then sends no response, --connect-timeout 15 no longer applies. Curl instead waits for --max-time "$orca_dl_t", which can be 840 seconds with one source. This breaks the stated WSL failure-time budget. Add an idle-response limit, such as a curl low-speed timeout, while retaining the longer limit for downloads that make progress. (curl.se)
The reason will be displayed to describe this comment to others. Learn more.
Minor · Stability & Availability · Quick win
Supported by static analysis
Script executed:
sed -n '1,180p' src/main/node-runtime/pinned-runtime-materializer.ts
sed -n '1,230p' src/main/node-runtime/runtime-archive-download.ts
sed -n '1,110p' src/main/ssh/orcad-node-runtime-install-options.ts
Share the desktop timeout across mirror and official requests.
withNodeDistMirror tries the official URL after a mirror timeout. Each request receives a fresh 15-second timeout, so desktop source iteration can consume 30 seconds. The host then has two 15-second source attempts, producing a 60-second path instead of the stated 45-second budget.
The budget test passes because it assumes one desktop attempt. Use one shared desktop deadline across both desktop sources, while preserving the host fallback after that deadline expires.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
The first time Orca sets up its server inside a WSL distro, it downloads Node (about 30 MB). It tries from this computer first, then from inside the distro. On a network that silently drops traffic, that took about two minutes before giving up. Now it gives up in about 45 seconds, and the error still says exactly how to fix it.
What Changed
runtime-archive-download.ts,pinned-runtime-materializer.ts): new optionalconnectTimeoutMs.remote-node-runtime-host-download.ts): the per-source connect timeout for curl--connect-timeoutand wget-Tis now a parameter. It defaults to the existing 20 s.deployOrcadtakes an optionalnodeRuntimeDownloadbudget, applied through a new smallorcad-node-runtime-install-options.ts.installOrcadBundleandensureRemoteOrcadNodeRuntimeto the host fallback.wsl-orcad-deploy.ts) passes it:WSL_NODE_RUNTIME_DOWNLOAD_BUDGET= 15 s desktop, 15 s per host source.NODEJS_ORG_MIRROR) and the offline archive path. The existing host-fallback test keeps covering that.Why
The win-lowspec QA run (signed 1.4.244, with the test instance's desktop traffic refused by a proxy) found the pinned Node runtime is not bundled for WSL targets. The template ships only the runtime marker, so a first deploy fetches it.
Worst case on a firewall that drops packets:
Alternatives considered:
Linked Issue
Follow-up to the win-lowspec WSL host proxy QA (flag-on checklist).
Visual Proof
N/A: no UI change. It changes download timing and failure speed only.
Testing
runtime-archive-download.test.ts:remote-node-runtime-host-download.test.ts: a realshrun of the generated command with fake curl and wget records--connect-timeout/-T. It shows 20 by default (SSH) and 15 when a WSL budget is passed.orcad-node-runtime-install-options.test.ts:wsl-orcad-deploy.test.ts: the WSL deploy passes the budget todeployOrcad.Suites: node-runtime, managed-server/install, the byte budget, orcad-remote-deploy, the SSH on-connect node download, wsl-orcad-deploy and orcad-runtime-deployment all pass (806).
Checks:
pnpm tc,pnpm run typecheck:ci,pnpm run check:code-quality:changed, oxlint, the anti-slop oxlint (plugin synced) and both ast-grep steps pass.I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Two reviewers requested: e9-reviewer and fix-reviewer-2.
Agent skill upstream boundary
Notes
User-risk:
Flag-off: only the WSL deploy passes the budget. SSH and every other caller keep today's timing (the defaults are unchanged and test-covered).
SSH: unaffected. This touches shared install code, but only through a new optional parameter that SSH doesn't pass.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)