fix(tauri): use navigator.platform for Windows detection in MCP spawn

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.
This commit is contained in:
Danila Poyarkov 2026-04-23 16:01:11 +03:00
parent 1bf19fff59
commit 8b5e372953

View file

@ -67,7 +67,7 @@ export async function spawnMCPIfNeeded(): Promise<AutomationServerHandle | null>
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: {