Skip to content

Commit de4e93b

Browse files
ouyyyyangclaude
andcommitted
fix: start-local-agent.ps1 crashes on Windows
Start-Process rejected -RedirectStandardOutput/-RedirectStandardError pointing at the same file ('inputs must be different'), so on Windows the launcher always threw before spawning the agent — start.bat, login, and the desktop console all appeared broken. Let the child PowerShell redirect its own streams via '*>> $LogFile' and drop the Start-Process redirection flags entirely. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b62f5c6 commit de4e93b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

scripts/dev/start-local-agent.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,14 @@ $serverCommand = @(
201201
"`$env:SCREEN_PILOT_PID_FILE='$PidFile'"
202202
"`$env:SCREEN_PILOT_PORT_FILE='$PortFile'"
203203
"Set-Location '$RootDir'"
204-
"& '$nodeAbsolute' build/node/core/agent/src/server.js"
204+
"& '$nodeAbsolute' build/node/core/agent/src/server.js *>> '$LogFile'"
205205
) -join "; "
206206

207207
$process = Start-Process `
208208
-FilePath "powershell.exe" `
209209
-ArgumentList @("-NoProfile", "-ExecutionPolicy", "Bypass", "-Command", $serverCommand) `
210210
-WorkingDirectory $RootDir `
211211
-WindowStyle Hidden `
212-
-RedirectStandardOutput $LogFile `
213-
-RedirectStandardError $LogFile `
214212
-PassThru
215213

216214
Set-Content -Path $PidFile -Value $process.Id

0 commit comments

Comments
 (0)