← Back to PRs

#17951: fix: macOS app: Skill binary detection does not respect /etc/paths or Homebrew PATH

by MisterGuy420 open 2026-02-16 10:14 View on GitHub →
app: macos gateway stale size: S trusted-contributor
## Summary Fixed skill binary detection on macOS to respect the system PATH configuration from /etc/paths and /etc/paths.d/. Previously, the app and gateway used hardcoded PATH values that excluded Homebrew paths like /opt/homebrew/bin, causing skill binary checks to fail for Homebrew-installed tools. ## Changes - src/daemon/service-env.ts: Added readMacosSystemPaths function to read /etc/paths and /etc/paths.d/ when building the gateway PATH - apps/macos/Sources/OpenClaw/CommandResolver.swift: Added readMacosSystemPaths function to read /etc/paths and /etc/paths.d/ for macOS app PATH ## Testing - All daemon tests pass (86 tests) - TypeScript compilation passes Fixes openclaw/openclaw#17890 <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixed skill binary detection on macOS to respect system PATH configuration from `/etc/paths` and `/etc/paths.d/`, resolving issues with Homebrew-installed tools not being detected. - Added `readMacosSystemPaths()` in both `service-env.ts` (TypeScript) and `CommandResolver.swift` (Swift) to read system PATH directories - Falls back to sensible defaults if `/etc/paths` doesn't exist or is empty - Includes proper error handling with try-catch blocks that silently fall back to defaults - Deduplicates paths to avoid repeated entries <h3>Confidence Score: 5/5</h3> - Safe to merge - implementation correctly fixes PATH detection on macOS - The implementation correctly reads `/etc/paths` and `/etc/paths.d/` to respect system PATH configuration, fixing the Homebrew detection issue. Both TypeScript and Swift code follow consistent patterns with proper error handling and fallbacks. All daemon tests pass according to the PR description. - No files require special attention <sub>Last reviewed commit: 90d8e84</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs