Repository navigation
Conversation
Hardening on top of the ignore-scripts native-deps repair so it can never leave a user worse off than before the change: - repairInstalledNativeDeps is now best-effort. An already-installed relay can always launch in degraded mode (fs/git/preflight still work), so a repair failure must not block the connection. Neither lock contention nor an offline/unbuildable repair aborts the deploy now: on lock-acquire failure we degrade without releasing a lock we do not hold; on repair-body failure we release our lock and fall through to a degraded launch. Pre-repair the health check used require.resolve (which passed for a present-but-unloadable binding), so a fatal repair here was a straight regression for offline / no-toolchain hosts. The fresh-install path keeps its fatal semantics. - RELAY_DEPLOY_TIMEOUT_MS now exceeds a first install AND its follow-up rebuild (2 x NATIVE_DEPS_INSTALL_TIMEOUT_MS + headroom) so a legitimate install-then-rebuild is not falsely timed out mid-repair. - shellEscape the two POSIX probe scripts instead of raw single-quoting so a future edit adding a quote can't silently break the node -e probe. Adds regression coverage for degraded-launch-on-repair-throw, degraded-launch when the repair lock can't be acquired, and the widened deploy-timeout bound. Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Co-authored-by: Orca <[email protected]>
Probe node-pty's actual Windows binding, reset broken package trees before repair, and keep degraded relays retryable after self-heal. Use atomic FileMode.CreateNew locks under Windows PowerShell 5.1 and cover lock races and platform-specific system SSH behavior.
npm 12 blocks node-pty/@parcel/watcher install scripts unless package.json lists them in allowScripts (exit 0 + warn). Linux has no node-pty prebuild, so terminals failed with "node-pty is not available on this remote host". Rebase #8686 onto main and harden: - emit versioned allowScripts + --ignore-scripts=false install/rebuild - real require() health probe + best-effort repair - single-flight loadPty so concurrent spawns cannot race mock vs disk module - repair test uses relay cwd and lib/index.js entry Closes #8720 Closes #8758
|
Warning Review limit reached
Next review available in: 47 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (30)
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 |
|
Superseded by merged PR #8686 (merge commit fa85536). #8686 contains the same native-dependency and npm repair plus the later Windows cross-version locking, GC and launch fencing, deployed-bundle node-pty reload, and Windows test hardening. Closing this earlier implementation to avoid landing duplicate or stale behavior. |
Summary
Remote SSH terminals fail with "node-pty is not available on this remote host" when the remote default npm is v12 (e.g. mise/asdf
node latest). npm 12 blocks lifecycle scripts not listed in package.jsonallowScripts(warn + exit 0), so Linux never buildspty.node. This PR makes the relay native-deps install declareallowScripts, force lifecycle scripts, probe with realrequire(), rebuild when needed, and safely repair already-installed broken trees.Also closes #8758 (same root on Debian 13). Rebases and lands the work from open #8686 onto current
main, with concurrentloadPtyhardening and #8720 regression tests.Root cause
[email protected]+@parcel/[email protected]and runsnpm install.allowScripts. Verified locally with npm 12.0.1:--ignore-scripts=falsealone still blocks;allowScripts: { \"[email protected]\": true, ... }unblocks.pty.node.ignore-scripts/ weakrequire.resolvehealth checks hide present-but-unloadable bindings (addressed in the same install/repair path).What changed
allowScriptsfor both native deps.npm install/npm rebuildpass--ignore-scripts=false.require()of both addons (notrequire.resolve).loadPty: single-flight load + cwd disk fallback so concurrent spawns cannot race mock/disk modules, and in-place npm repair is visible without restart.ssh-relay-npm12-allow-scripts.test.tspins the [Bug]: SSH relay npm install silently skips node-pty build under npm 12 (allowScripts) — "node-pty is not available on this remote host" #8720 contract.Evidence
npm install --ignore-scripts=falseallowScriptsname@versionsrc/main/sshsuite: 758 passed / 9 skippedpty-handler+subprocess+ native-deps install + npm12 regression: 151 passedpnpm run typecheck:nodeclean; oxlint clean on touched filesELI5
Orca installs a small helper on the SSH machine so remote terminals work. That helper needs a native piece (
node-pty) that must be built on Linux. New npm versions refuse to run build scripts unless the project explicitly allows them — and we weren't allowing them — so the piece never got built, but install still said "ok". Terminals then died with a confusing error. We now allow those scripts, double-check the piece actually loads, and try a rebuild if it doesn't.User-facing regression list
@parcel/watcher-only failure may still be tagged[NPTY-MISSING]; Windows probe stderr capture is limited.Testing
pnpm exec vitest run --config config/vitest.config.ts src/main/ssh— 758 pass / 9 skippnpm exec vitest run --config config/vitest.config.ts src/main/ssh/ssh-relay-npm12-allow-scripts.test.ts src/main/ssh/ssh-relay-native-deps-install.test.ts src/relay/pty-handler.test.ts src/relay/subprocess.test.tspnpm run typecheck:nodeSecurity
Fixed dep names/versions only; POSIX
shellEscape/ PowerShell literals unchanged. No new auth, secrets, or IPC. Probe diagnostics remain bounded stdout/stderr tails.Related