fix(agent): remove the node PATH shim#3285
Merged
Merged
Conversation
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Contributor
|
Reviews (1): Last reviewed commit: "remove the electron node PATH shim" | Re-trigger Greptile |
gantoine
approved these changes
Jul 9, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
Agent process trees get a fake
nodeon PATH that actually runs the desktop app binary viaELECTRON_RUN_AS_NODE. When that env var gets lost along the way (dotfiles, env-scrubbing tools), runningnodeboots a full desktop app instead: the phantom window storms #3239 tried to fix. The wrapper-script fix narrowed the hole but could not close it (stale shims from older installs, dev builds, win32 terminals), and even when the shim works it serves the wrong runtime: Electron's node breaks native addons built for real node and shadows nvm/mise-selected versions.Both original reasons for the shim are gone: the claude CLI is a native binary now, and
fixPath()already puts the user's login-shell PATH (and so their real node) on agent PATHs.Changes
nodealias is written to$TMPDIR/agent-node-*, no PATH prepend into the workspace-server env, and the wrapper/symlink heal and codex PATH-strip logic are deleted.nodenow resolves through the user's own environment, exactly like their terminal outside the app.legacy-node-shim.ts), so leftovers on disk can't keep phantom-booting after an update.process.execPathwith explicitELECTRON_RUN_AS_NODE=1), which never depended on the shim.Machines with no node installed lose the implicit fallback and get a plain "node: command not found". A vendored runtime for zero-setup is tracked in #3114.
Refs #3114.
How did you test this?
pnpm typecheckgreen (23 packages).legacy-node-shim.test.tscovers removal of real dirs with file and symlink contents, and the nothing-to-clean case.Automatic notifications