From a76404581d31a100fcd27fc55febc18dd6cf3408 Mon Sep 17 00:00:00 2001 From: Emilson Moraes Date: Fri, 30 Jan 2026 12:06:00 -0300 Subject: [PATCH] fix(daemon): include user bin dirs in macOS LaunchAgent PATH MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The LaunchAgent plist was missing user bin directories on macOS, causing skills that depend on binaries installed via volta, pnpm, bun, cargo, etc. to show as 'blocked' in the UI. Changes: - Rename resolveLinuxUserBinDirs → resolvePosixUserBinDirs - Apply user bin dir resolution for both 'linux' and 'darwin' platforms - Add macOS-specific pnpm path (~/Library/pnpm) - Add cargo bin path (~/.cargo/bin) Fixes #4699 --- src/daemon/service-env.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/daemon/service-env.ts b/src/daemon/service-env.ts index 2afdcfc6a..183a73d60 100644 --- a/src/daemon/service-env.ts +++ b/src/daemon/service-env.ts @@ -36,10 +36,10 @@ function resolveSystemPathDirs(platform: NodeJS.Platform): string[] { } /** - * Resolve common user bin directories for Linux. + * Resolve common user bin directories for POSIX systems (Linux and macOS). * These are paths where npm global installs and node version managers typically place binaries. */ -export function resolveLinuxUserBinDirs( +export function resolvePosixUserBinDirs( home: string | undefined, env?: Record, ): string[] { @@ -74,8 +74,10 @@ export function resolveLinuxUserBinDirs( dirs.push(`${home}/.fnm/current/bin`); // fnm dirs.push(`${home}/.volta/bin`); // Volta dirs.push(`${home}/.asdf/shims`); // asdf - dirs.push(`${home}/.local/share/pnpm`); // pnpm global bin + dirs.push(`${home}/.local/share/pnpm`); // pnpm global bin (Linux) + dirs.push(`${home}/Library/pnpm`); // pnpm global bin (macOS) dirs.push(`${home}/.bun/bin`); // Bun + dirs.push(`${home}/.cargo/bin`); // Rust/Cargo return dirs; } @@ -88,9 +90,11 @@ export function getMinimalServicePathParts(options: MinimalServicePathOptions = const extraDirs = options.extraDirs ?? []; const systemDirs = resolveSystemPathDirs(platform); - // Add Linux user bin directories (npm global, nvm, fnm, volta, etc.) - const linuxUserDirs = - platform === "linux" ? resolveLinuxUserBinDirs(options.home, options.env) : []; + // Add user bin directories for POSIX systems (npm global, nvm, fnm, volta, pnpm, bun, etc.) + const posixUserDirs = + platform === "linux" || platform === "darwin" + ? resolvePosixUserBinDirs(options.home, options.env) + : []; const add = (dir: string) => { if (!dir) return; @@ -99,7 +103,7 @@ export function getMinimalServicePathParts(options: MinimalServicePathOptions = for (const dir of extraDirs) add(dir); // User dirs first so user-installed binaries take precedence - for (const dir of linuxUserDirs) add(dir); + for (const dir of posixUserDirs) add(dir); for (const dir of systemDirs) add(dir); return parts;