#22370: fix(skills): resolve Homebrew/common binary locations
gateway
size: S
Cluster:
Node and macOS Enhancements
## what changed
- Updated `src/shared/config-eval.ts` so `hasBinary` always checks common install directories (including `/opt/homebrew/bin`) in addition to `PATH`.
- Added `src/shared/config-eval.test.ts` covering:
- binary detection from `PATH`
- fallback probing when `PATH` is minimal/non-login.
## why this fixes the issue
Skill readiness checks (used by `skills`/`skills check`) run in processes where PATH may not include Homebrew binary directories. This made `gh` appear missing for `github`/`gh-issues` in Control UI even when it works in CLI. The fallback scan restores correct detection in those environments.
## tests
- `pnpm test src/shared/config-eval.test.ts`
## edge cases
- `hasBinary` cache remains keyed by PATH and PATHEXT.
- On Windows, existing `PATHEXT` + PATH behavior is preserved.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Enhanced binary detection to include common install directories (`/opt/homebrew/bin`, `/usr/local/bin`, etc.) when PATH is incomplete, fixing false negatives for Homebrew-installed tools like `gh` in runtime environments with minimal PATH. Also improved gateway auth to auto-approve scope upgrades for loopback connections, reducing unnecessary pairing prompts for local paired devices.
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with minor considerations around the security policy change for loopback connections
- The binary detection fallback is well-tested and platform-gated (non-Windows only). The gateway auth change is logical (loopback connections are already trusted) and properly tested with new e2e tests. One test was renamed for clarity. Cache invalidation properly handles PATH changes.
- Pay close attention to `src/gateway/server/ws-connection/message-handler.ts` to ensure the loopback auto-approval logic aligns with security expectations
<sub>Last reviewed commit: 4c5d500</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#17929: fix(skills): augment PATH with /etc/paths on macOS for binary detec...
by lailoo · 2026-02-16
82.2%
#21116: fix(skills): don't cache negative binary lookups
by heyrtl · 2026-02-19
80.6%
#17951: fix: macOS app: Skill binary detection does not respect /etc/paths ...
by MisterGuy420 · 2026-02-16
80.4%
#9516: fix(skills): detect Windows executables with extensions
by yhl10000 · 2026-02-05
79.6%
#16295: fix: filter brew install options when brew is unavailable
by superlowburn · 2026-02-14
78.1%
#21733: security(exec): platform-aware allowlist matching and restricted sa...
by Esubaalew · 2026-02-20
75.4%
#15475: fix(update): Handle Homebrew+Node Cellar path mismatch
by brandonwise · 2026-02-13
74.9%
#9227: Fix: Windows Web UI shows 'brew not installed' for all skills
by vishaltandale00 · 2026-02-05
74.9%
#8075: fix(skills): add --ignore-scripts to all package managers
by yubrew · 2026-02-03
74.7%
#22110: fix(tools): prefer loopback for internal tool-to-gateway RPC calls
by pierreeurope · 2026-02-20
74.7%