#17951: fix: macOS app: Skill binary detection does not respect /etc/paths or Homebrew PATH
app: macos
gateway
stale
size: S
trusted-contributor
Cluster:
Node and macOS Enhancements
## 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
#4709: fix(daemon): include user bin dirs in macOS LaunchAgent PATH
by ekson73 · 2026-01-30
82.1%
#17929: fix(skills): augment PATH with /etc/paths on macOS for binary detec...
by lailoo · 2026-02-16
81.3%
#22370: fix(skills): resolve Homebrew/common binary locations
by AIflow-Labs · 2026-02-21
80.4%
#23079: fix(skills): fallback to npm for summarize skill on non-darwin systems
by charojo · 2026-02-22
77.6%
#18112: fix(daemon): gateway install on macOS ignores fnm/nvm node (#18090)
by yinghaosang · 2026-02-16
76.9%
#9227: Fix: Windows Web UI shows 'brew not installed' for all skills
by vishaltandale00 · 2026-02-05
75.8%
#6064: fix(daemon): prefer bundled node from install-cli.sh over system node
by joyshmitz · 2026-02-01
74.4%
#16295: fix: filter brew install options when brew is unavailable
by superlowburn · 2026-02-14
74.1%
#22929: Fix NODE_EXTRA_CA_CERTS missing from LaunchAgent environment on macOS
by Clawborn · 2026-02-21
74.1%
#19931: Config: merge PATH env vars and bootstrap Windows bins
by Kemalau · 2026-02-18
72.8%