Repository navigation
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The PR addresses packaged Windows terminal startup without an identified remaining merge-blocking risk. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 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.
Important
The added branch keys off process.resourcesPath, and I could not find that set anywhere the relay actually runs. If the relay only ever executes remotely under a host-discovered plain node, this branch is inert and the reported failure has another cause. Please point at the launcher that sets it, or add a test that pins the selection.
Reviewed changes
- Prefer packaged
node-pty—relayNodePtyDir()now returnsprocess.resourcesPath/node_modules/node-ptywhenprocess.resourcesPathis a string and that directory exists, otherwise the pre-existingjoin(__dirname, 'node_modules', 'node-pty')(src/relay/pty-handler.ts:647).
⚠️ The new branch may never execute for the relay
process.resourcesPath is set by Electron, but the relay bundle is deployed to a remote host and launched with a host-discovered plain node, where process.resourcesPath is undefined. If that is the only production path, packagedDir is always '' and the change is a no-op — meaning the Windows failure it targets would need a different fix. Resources/node_modules/node-pty itself is genuine, so the path is right; the open question is reachability.
Technical details
# Reachability of the packaged node-pty branch
## Affected sites
- `src/relay/relay-runtime-services.ts:46` — the only non-test `new PtyHandler(...)`, reached only via `src/relay/relay-daemon.ts` ← `src/relay/relay.ts`.
- `src/main/ssh/ssh-relay-deploy.ts:1802` — POSIX launch `nohup ${escapedNode} relay.js --detached ...`.
- `src/main/ssh/ssh-relay-deploy.ts:2155` — Windows PowerShell launch `& ${nodePath} relay.js --connect ...`.
- `src/main/ssh/ssh-remote-node-resolution.ts` — `nodePath` comes from the remote probe, never `process.execPath`.
- `config/scripts/build-relay.mjs:35,109-135` — `relay.js` is a standalone CJS bundle (`electron`/`node-pty` external), not an Electron `out/main` input.
- `src/main/ipc/parcel-watcher-entry-path.ts:48` — `ELECTRON_RUN_AS_NODE` children do expose `resourcesPath`, but no relay/`PtyHandler` child is launched that way.
- `config/packaged-runtime-node-modules.cjs:24,211-216` and `src/main/daemon/daemon-host-relocation.ts:183` — confirm `Resources/node_modules/node-pty` is the real packaged location, so the path itself is correct.
## Required outcome
- Identify the launcher/configuration under which the relay process has `process.resourcesPath` set, or state that this is an intentional defensive fallback and name the actual cause of the remote Windows failure.
- A test that stubs `process.resourcesPath` and `__dirname` and asserts the selected candidate would pin the selection logic regardless.
## Open question for the human
- Did the Windows 11 reproduction actually exercise the disk fallback (normal `import('node-pty')` failing), or verify only that terminals start? A healthy import never reaches `relayNodePtyDir()`.ℹ️ Nitpicks
- The new comment describes the
__dirnamefallback as what "development bundles" use, butconfig/scripts/build-relay.mjsstages nonode_modulesbesiderelay.js; that path is really the deployed remote relay layout (the relay dir ownsnode_modulesor a symlink to the shared native-deps cache). Worth rewording so the intent stays clear. - No test pins the new branch, so the
resourcesPathpresent/absent behavior can regress unnoticed.
DeepSeek Flash (free via Pullfrog for OSS) | 𝕏
08c5400 to
62c5037
Compare

Problem
Packaged Windows SSH relays could not start remote terminals when the normal
node-ptyload failed. The fallback resolver searched onlyResources/relay/node_modules/node-pty, while packaged runtime dependencies are copied to the siblingResources/node_modules/node-ptydirectory.Fix
Resolve the packaged
node-ptyinstallation throughprocess.resourcesPath/node_modules/node-pty, retaining the relay-local path for development bundles.Fixes STA-7343
Validation
win32 x64)