From 65a809c13843d41cede5c9e0cb43a62e4bfa0eeb Mon Sep 17 00:00:00 2001 From: DANGO Date: Fri, 16 Jan 2026 21:24:28 +0800 Subject: [PATCH] fix: correct PATH separator for Windows in agent detection - Fix getEnhancedPath() to use ';' instead of ':' on Windows - Fix Settings.tsx agent status check to handle undefined agent results - This resolves opencode detection failure on Windows systems - Platform-aware separator selection ensures cross-platform compatibility - UI now properly displays agent installation status Fixes multica-ai/multica issue where opencode showed as not installed despite being properly installed and available in PATH. --- src/main/utils/path.ts | 6 ++++-- src/renderer/src/components/Settings.tsx | 12 +++++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/main/utils/path.ts b/src/main/utils/path.ts index 71ddc87e97..a2f60b467d 100644 --- a/src/main/utils/path.ts +++ b/src/main/utils/path.ts @@ -1,7 +1,7 @@ /** * Path utilities for agent process management */ -import { homedir } from 'node:os' +import { homedir, platform } from 'node:os' /** * Get enhanced PATH that includes common custom installation directories @@ -9,6 +9,8 @@ import { homedir } from 'node:os' */ export function getEnhancedPath(): string { const home = homedir() + const isWindows = platform() === 'win32' + const separator = isWindows ? ';' : ':' const customPaths = [ `${home}/.opencode/bin`, `${home}/.claude/local/bin`, @@ -16,5 +18,5 @@ export function getEnhancedPath(): string { '/opt/homebrew/bin', '/usr/local/bin' ] - return `${customPaths.join(':')}:${process.env.PATH || ''}` + return `${customPaths.join(separator)}${separator}${process.env.PATH || ''}` } diff --git a/src/renderer/src/components/Settings.tsx b/src/renderer/src/components/Settings.tsx index 49bd11154b..6430f70cb7 100644 --- a/src/renderer/src/components/Settings.tsx +++ b/src/renderer/src/components/Settings.tsx @@ -302,11 +302,13 @@ function AgentItem({ // Determine status: checking -> setup/selected/ready const status = isChecking ? 'checking' - : !agent?.installed - ? 'setup' - : isSelected - ? 'selected' - : 'ready' + : agent === undefined + ? 'checking' // Still loading agent status + : !agent?.installed + ? 'setup' + : isSelected + ? 'selected' + : 'ready' // Auto-expand when waiting for install useEffect(() => {