← Back to PRs

#22370: fix(skills): resolve Homebrew/common binary locations

by AIflow-Labs open 2026-02-21 02:45 View on GitHub →
gateway size: S
## 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