Skip to content

fix(startup): omit Linux-only package mgrs from PATH on non-Linux - #12566

Merged
AmethystLiang merged 1 commit into
mainfrom
bug-helpers-ps-docker-polling-with-phantom-linux
Aug 4, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
bug-helpers-ps-docker-polling-with-phantom-linux

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Aug 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Omit snap and Linuxbrew from PATH on non-Linux platforms (darwin, freebsd, etc.) to eliminate phantom PATH entries that waste CPU cycles on stat calls during every process spawn. Nix is retained across all POSIX platforms since it ships macOS and BSD installers.

Screenshots

No visual change.

Testing

  • Added test: darwin omits snap/Linuxbrew but retains Nix and homebrew
  • Added test: linux keeps snap, Linuxbrew, and Nix with correct precedence
  • Added test: freebsd (non-Linux POSIX) omits snap/Linuxbrew but retains Nix
  • pnpm lint
  • pnpm typecheck
  • pnpm test
  • pnpm build

Notes

Platform-specific behavior:

  • snap and /home/linuxbrew are Linux-only, so removed from non-Linux extraPaths to avoid stat misses
  • Nix kept for all POSIX platforms since official installers exist for macOS/BSD
  • homebrew and /usr/local remain on all non-Windows platforms

Fixes #12398

Snap and Linuxbrew don't ship installers for Darwin or BSD, so seeding
their PATH entries on those platforms adds phantom directories every
spawn must stat. Keep them on Linux only, while preserving Nix and
Homebrew across all platforms as they have multi-platform support.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 9e581f6d-0b37-4a56-a5ca-3a2356d67b91

📥 Commits

Reviewing files that changed from the base of the PR and between e138d28 and bd0ccca.

📒 Files selected for processing (2)
  • src/main/startup/configure-process.test.ts
  • src/main/startup/configure-process.ts

📝 Walkthrough

Walkthrough

patchPackagedProcessPath now adds Snap and Linuxbrew directories only on Linux. Other non-Windows platforms retain Nix, Homebrew, and /usr/local/bin entries as applicable. New packaged-process tests verify PATH inclusion, exclusion, and ordering for macOS, Linux, and other POSIX platforms.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the summary, visual change, tests, and notes, but omits the required AI Review Report and Security Audit sections. Add the AI Review Report and Security Audit sections, and report the status or rationale for the remaining lint, typecheck, test, and build checks.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: excluding Linux-only package manager paths from non-Linux PATH values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmethystLiang
AmethystLiang merged commit 2073f7e into main Aug 4, 2026
43 checks passed
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…ablyai#12566)

Snap and Linuxbrew don't ship installers for Darwin or BSD, so seeding
their PATH entries on those platforms adds phantom directories every
spawn must stat. Keep them on Linux only, while preserving Nix and
Homebrew across all platforms as they have multi-platform support.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Helper's ps/docker polling with phantom Linux PATH entries triggers macOS autofs/opendirectoryd storm (amplified by EDR)

1 participant