Fix agent CLI detection on Homebrew installs (Apple Silicon /opt/homebrew, Linuxbrew) - #47
Merged
Merged
Conversation
…brew, Linuxbrew) resolveAgentCommand's fallback dirs missed Homebrew's prefix bin, so an opencode (or claude/copilot) installed via brew read as not-installed and was greyed out client-side. Add /opt/homebrew/bin and /home/linuxbrew/.linuxbrew/bin to the common fallbacks (SANDBOX_PATH and which() untouched, preserving the sandbox-PATH matching contract), and to the gh wrapper bind candidates. Host-dependent Homebrew test added with the existing skip gate.
nananek
force-pushed
the
fix/homebrew-opencode-detection
branch
from
August 14, 2026 04:41
13f4ee3 to
3f6015f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Homebrew 環境 (macOS Apple Silicon) で opencode が起動モーダルから選択できない不具合の修正。
resolveAgentCommandの fallback 検索ディレクトリに Homebrew のプレフィックス bin (/opt/homebrew/bin= Apple Silicon、/home/linuxbrew/.linuxbrew/bin= Linuxbrew) が含まれておらず、brew install opencodeで入る CLI がfound: false→ 「サーバーに未インストール」扱いでグレーアウトしていた。Intel Mac の/usr/local/binはSANDBOX_PATHに含まれるため Apple Silicon 固有の問題。Changes
server/ws/sandbox.js:resolveAgentCommandの candidates に/opt/homebrew/binと/home/linuxbrew/.linuxbrew/binを追加。SANDBOX_PATHとwhich()は不変 (サンドボックス内 PATH と検出を一致させる既存契約を維持)server/ws/sandbox.js:ghの bind fallback 候補にも/opt/homebrew/bin/ghを追加server/ws/sandbox-resolve.test.js: Homebrew インストール実在時のみ実行される skip gate 付きテストを追加 (CI の Linux ホストには影響なし)Tests
npm test: 345 pass / 0 fail (Homebrew テストはホストに brew インストールがないため skip)