From 8b5e372953d0be152108ac5fabf2f983c6007fde Mon Sep 17 00:00:00 2001 From: Danila Poyarkov Date: Thu, 23 Apr 2026 16:01:11 +0300 Subject: [PATCH] fix(tauri): use navigator.platform for Windows detection in MCP spawn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit navigator.userAgent may not contain 'Windows' in all WebView2 contexts. navigator.platform.includes('Win') is more reliable. Verified working on Windows x64 VM — MCP server spawns via cmd /c and connects successfully. --- src/automation/spawn-mcp.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/automation/spawn-mcp.ts b/src/automation/spawn-mcp.ts index 3e8ed21bf..a5ebbb581 100644 --- a/src/automation/spawn-mcp.ts +++ b/src/automation/spawn-mcp.ts @@ -67,7 +67,7 @@ export async function spawnMCPIfNeeded(): Promise runtimeAutomationAuthToken = authToken const { Command } = await import('@tauri-apps/plugin-shell') - const isWindows = navigator.userAgent.includes('Windows') + const isWindows = navigator.platform.includes('Win') const command = isWindows ? Command.create('cmd', ['/c', 'openpencil-mcp-http'], { env: {