Domain: Automation, Operations Verification: Confirmed (reproduced across multiple sessions) First observed: 2026-03-26 Last verified: 2026-03-27 knowledge_store: kc-2026-03-26-028, kc-2026-03-27-001
Warning
Symptoms
Cause 1 (Confirmed) — Zombie Python Process Accumulation
# Check for zombie processes
Get-Process python* | Where-Object { $_.HasExited -or $_.Responding -eq $false }
# Clean up zombies
Stop-Process -Name python* -Force -ErrorAction SilentlyContinue
Cause 2 (Suspected) — stdin/stdout Pipe Collision
Remedies (by priority)
Method 1: Start-Process -RedirectStandardOutput + check result file (recommended)
$env:PYTHONUTF8 = "1"
Start-Process -FilePath "C:\Python314\python.exe" `
-ArgumentList "C:\...\script.py" `
-RedirectStandardOutput "~\temp\out.txt" `
-RedirectStandardError "~\temp\err.txt" `
-NoNewWindow -Wait -PassThru | Select-Object ExitCode
Even if the PowerShell MCP times out, Python continues running in the background. Check the result file afterward with mcp__Windows-MCP__FileSystem read.
Method 2: Background Job + Wait-Job
$PY = "C:\Python314\python.exe"
$SCRIPT = "C:\path\to\script.py"
$job = Start-Job -ScriptBlock { param($py, $s) & $py $s 2>&1 } -ArgumentList $PY, $SCRIPT
$done = Wait-Job -Job $job -Timeout 45
if ($done) { Receive-Job $job; Remove-Job $job; "DONE" }
else { Stop-Job $job; Remove-Job $job; "TIMEOUT" }
Method 3: Process in Linux VM, then Write via MCP FileSystem
Method 4: Manipulate file system directly with PowerShell
$data = Get-Content $path -Raw | ConvertFrom-Json
# ... manipulate ...
$data | ConvertTo-Json -Depth 10 | Set-Content $path -Encoding UTF8NoBOM
Note: PowerShell's ConvertFrom-Json can be unstable with non-ASCII JSON content.
Method 5: Write Python output to file
with open(r"C:\...\result.txt", "w") as f:
f.write("OK")