From 6ce21650f3a1083822cf2f4f776a4d5f0865e98e Mon Sep 17 00:00:00 2001 From: Johnny Huynh <27847622+johnnyhuy@users.noreply.github.com> Date: Sat, 22 Aug 2026 23:32:49 +1000 Subject: [PATCH] fix(main): derive harness binaries from all install methods discoverHarnesses only read installMethods[0] for the binary name and fell back to the catalog id. Claude Code's first method is brew (no binary field), so discovery searched PATH for 'claude-code' instead of 'claude' and reported an installed harness as missing. Co-authored-by: opencode-agent[bot] <219766164+opencode-agent[bot]@users.noreply.github.com> --- src/main/library.ts | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/library.ts b/src/main/library.ts index 33cf840..e345bda 100644 --- a/src/main/library.ts +++ b/src/main/library.ts @@ -513,12 +513,14 @@ function entriesFromInstalls( async function discoverHarnesses(): Promise { const out: LibraryEntry[] = [] for (const entry of HARNESS_CATALOG) { - const binary = - entry.installMethods[0]?.type === 'npm' - ? (entry.installMethods[0] as { binary?: string }).binary ?? entry.id - : entry.id - - const installs = await collectInstalls([binary], entry.name, ['--version']) + // Binary names can live on any install method (npm/binary, brew, …) and + // may differ from the catalog id (claude-code → claude). + const named = entry.installMethods + .map((m) => (m as { binary?: string }).binary) + .filter((b): b is string => Boolean(b)) + const binaries = named.length > 0 ? [...new Set(named)] : [entry.id] + + const installs = await collectInstalls(binaries, entry.name, ['--version']) let config = emptyConfig(installs.length ? 'binary not configured' : 'binary not on PATH') if (installs.length > 0) {