diff --git a/server/cursor-cli.js b/server/cursor-cli.js index b86facb5..c2364438 100644 --- a/server/cursor-cli.js +++ b/server/cursor-cli.js @@ -1,12 +1,8 @@ import { spawn } from 'cross-spawn'; -import crossSpawn from 'cross-spawn'; import { notifyRunFailed, notifyRunStopped } from './services/notification-orchestrator.js'; import { cursorAdapter } from './providers/cursor/adapter.js'; import { createNormalizedMessage } from './providers/types.js'; -// Use cross-spawn on Windows for better command execution -const spawnFunction = process.platform === 'win32' ? crossSpawn : spawn; - let activeCursorProcesses = new Map(); // Track active processes by session ID const WORKSPACE_TRUST_PATTERNS = [ @@ -122,7 +118,7 @@ async function spawnCursor(command, options = {}, ws) { console.log('Working directory:', workingDir); console.log('Session info - Input sessionId:', sessionId, 'Resume:', resume); - const cursorProcess = spawnFunction('cursor-agent', args, { + const cursorProcess = spawn('cursor-agent', args, { cwd: workingDir, stdio: ['pipe', 'pipe', 'pipe'], env: { ...process.env } // Inherit all environment variables diff --git a/server/gemini-cli.js b/server/gemini-cli.js index 8d679e56..fd172ae7 100644 --- a/server/gemini-cli.js +++ b/server/gemini-cli.js @@ -1,8 +1,4 @@ import { spawn } from 'cross-spawn'; -import crossSpawn from 'cross-spawn'; - -// Use cross-spawn on Windows for correct .cmd resolution (same pattern as cursor-cli.js) -const spawnFunction = process.platform === 'win32' ? crossSpawn : spawn; import { promises as fs } from 'fs'; import path from 'path'; import os from 'os'; @@ -168,7 +164,7 @@ async function spawnGemini(command, options = {}, ws) { } return new Promise((resolve, reject) => { - const geminiProcess = spawnFunction(spawnCmd, spawnArgs, { + const geminiProcess = spawn(spawnCmd, spawnArgs, { cwd: workingDir, stdio: ['pipe', 'pipe', 'pipe'], env: { ...process.env } // Inherit all environment variables