Skip to content

Fix agent CLI detection on Homebrew installs (Apple Silicon /opt/homebrew, Linuxbrew) - #47

Merged
nananek merged 1 commit into
masterfrom
fix/homebrew-opencode-detection
Aug 14, 2026
Merged

Fix agent CLI detection on Homebrew installs (Apple Silicon /opt/homebrew, Linuxbrew)#47
nananek merged 1 commit into
masterfrom
fix/homebrew-opencode-detection

Conversation

@nananek

@nananek nananek commented Aug 14, 2026

Copy link
Copy Markdown
Owner

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/binSANDBOX_PATH に含まれるため Apple Silicon 固有の問題。

Changes

  • server/ws/sandbox.js: resolveAgentCommand の candidates に /opt/homebrew/bin/home/linuxbrew/.linuxbrew/bin を追加。SANDBOX_PATHwhich() は不変 (サンドボックス内 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)

…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
nananek force-pushed the fix/homebrew-opencode-detection branch from 13f4ee3 to 3f6015f Compare August 14, 2026 04:41
@nananek
nananek merged commit e72e2da into master Aug 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant