Commit 9688b96
fix: don't write launcher PID into agent.pid on Windows
start-local-agent.ps1 was writing the wrapper PowerShell's PID into
agent.pid before node even started. The agent's ensureSingleInstance()
in server.ts then read that PID, saw the wrapper was still alive
(naturally — it's node's parent), and aborted with "Another Screen
Pilot agent is already running". server.ts writes its own real PID
after binding the port, so the ps1 has no business pre-writing it.
Also fix log encoding: replace '*>> \$LogFile' with
'2>&1 | Out-File -Encoding utf8 -Append' so agent.log is clean UTF-8
instead of UTF-16 LE.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent de4e93b commit 9688b96
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| |||
0 commit comments