← Back to PRs

#4709: fix(daemon): include user bin dirs in macOS LaunchAgent PATH

by ekson73 open 2026-01-30 15:06 View on GitHub →
gateway
## Summary The LaunchAgent plist was missing user bin directories on macOS, causing skills that depend on binaries installed via user package managers (volta, pnpm, bun, cargo, etc.) to show as 'blocked' in the UI. ## Root Cause The function `resolveLinuxUserBinDirs` already had all the logic to resolve user bin directories, but it was only being called for Linux: ```typescript // Before (bug): const linuxUserDirs = platform === "linux" ? resolveLinuxUserBinDirs(options.home, options.env) : []; ``` ## Changes - Rename `resolveLinuxUserBinDirs` → `resolvePosixUserBinDirs` (more accurate name) - Apply user bin dir resolution for both `linux` and `darwin` platforms - Add macOS-specific pnpm path (`~/Library/pnpm`) - Add cargo bin path (`~/.cargo/bin`) ## After ```typescript // After (fixed): const posixUserDirs = platform === "linux" || platform === "darwin" ? resolvePosixUserBinDirs(options.home, options.env) : []; ``` ## Testing 1. Run `clawdbot gateway install` on macOS 2. Check `~/Library/LaunchAgents/com.clawdbot.gateway.plist` 3. Verify PATH includes user bin dirs (volta, pnpm, bun, etc.) 4. Confirm skills using those binaries show as 'ready' instead of 'blocked' ## Related Fixes #4699 <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR updates the daemon’s service PATH construction to include common *user* bin directories on macOS (in addition to Linux), so launchd-launched processes can find binaries installed via user-scoped package managers (volta/pnpm/bun/cargo/etc.). It does so by renaming the helper to `resolvePosixUserBinDirs`, adding a couple of additional paths, and using it for both `linux` and `darwin` in `getMinimalServicePathParts`. <h3>Confidence Score: 4/5</h3> - This PR is likely safe to merge and should improve launchd PATH behavior on macOS. - Changes are localized to PATH construction and primarily add additional candidate directories plus a rename; the main risk is whether the added pnpm directory matches real-world macOS pnpm setups, but incorrect extra PATH entries are generally low impact. - src/daemon/service-env.ts <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs