File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -267,11 +267,30 @@ jobs:
267267 Write-Host " Killing PID $($_.Id)"
268268 $_ | Stop-Process -Force -ErrorAction SilentlyContinue
269269 }
270- Start-Sleep -Seconds 1
270+ Start-Sleep -Seconds 2
271271 } else {
272272 Write-Host "No other pwsh processes found"
273273 }
274274
275+ # Clean up any existing Named Pipe socket files (Linux/macOS)
276+ if (-not $IsWindows) {
277+ $pipeFile = "/tmp/CoreFxPipe_PowerShell.MCP.Communication"
278+ if (Test-Path $pipeFile) {
279+ Write-Host "Removing existing Named Pipe socket: $pipeFile"
280+ Remove-Item $pipeFile -Force -ErrorAction SilentlyContinue
281+ Start-Sleep -Seconds 1
282+ }
283+ }
284+
285+ # Verify Named Pipe is gone
286+ $pipeName = "PowerShell.MCP.Communication"
287+ if ($IsWindows) {
288+ $pipeExists = Test-Path "\\.\pipe\$pipeName"
289+ } else {
290+ $pipeExists = Test-Path "/tmp/CoreFxPipe_$pipeName"
291+ }
292+ Write-Host "Named Pipe exists before starting background pwsh: $pipeExists"
293+
275294 # Start a background pwsh process with PowerShell.MCP imported
276295 Write-Host "Starting background pwsh with PowerShell.MCP..."
277296 $bgPsi = [System.Diagnostics.ProcessStartInfo]::new()
You can’t perform that action at this time.
0 commit comments