Command: powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop';$root='C:\Users\ash\Documents\Codex\2026-08-26\LaptopBridge-DEV';$cfg=Get-Content -Raw -LiteralPath (Join-Path $root 'config.json')|ConvertFrom-Json;if([int]$cfg.port -ne 8766){throw 'DEV_CONFIG_PORT_GUARD_FAILED'};$old=@();for($round=0;$round -lt 4;$round++){$ls=@(Get-NetTCPConnection -LocalPort 8766 -State Listen -ErrorAction SilentlyContinue);$ids=@($ls|Select-Object -ExpandProperty OwningProcess -Unique);if($ids.Count -eq 0){break};foreach($pid8766 in $ids){$p=Get-CimInstance Win32_Process -Filter ('ProcessId='+$pid8766) -ErrorAction Stop;if([string]$p.CommandLine -notlike '*dev_bridge_launcher.py*'){throw ('UNSAFE_8766_OWNER_'+$pid8766)};$old += $pid8766};foreach($pid8766 in $ids){Stop-Process -Id $pid8766 -Force -ErrorAction Stop};Start-Sleep -Milliseconds 700};if(@(Get-NetTCPConnection -LocalPort 8766 -State Listen -ErrorAction SilentlyContinue).Count -ne 0){throw 'DEV_PORT_NOT_FREED'};$py=(Get-Command python.exe -ErrorAction Stop).Source;$data=Join-Path $root 'bridge-data';$new=Start-Process -FilePath $py -ArgumentList 'dev_bridge_launcher.py' -WorkingDirectory $root -WindowStyle Hidden -RedirectStandardOutput (Join-Path $data 'dev-bridge.stdout.log') -RedirectStandardError (Join-Path $data 'dev-bridge.stderr.log') -PassThru;Start-Sleep -Seconds 4;$r=Invoke-WebRequest -UseBasicParsing 'http://127.0.0.1:8766/health' -TimeoutSec 5;$prod=Invoke-WebRequest -UseBasicParsing 'http://127.0.0.1:8765/health' -TimeoutSec 5;$owners=@(Get-NetTCPConnection -LocalPort 8766 -State Listen -ErrorAction Stop|Select-Object -ExpandProperty OwningProcess -Unique);if($owners.Count -ne 1){throw ('DEV_LISTENER_COUNT_'+$owners.Count)};$op=Get-CimInstance Win32_Process -Filter ('ProcessId='+$owners[0]);if([string]$op.CommandLine -notlike '*dev_bridge_launcher.py*'){throw 'NEW_DEV_OWNER_IDENTITY_FAILED'};[pscustomobject]@{ok=($r.Content.Trim() -eq 'OK' -and $prod.Content.Trim() -eq 'OK');dev_health=$r.Content.Trim();prod_health=$prod.Content.Trim();old_pids=@($old|Select-Object -Unique);new_pid=$owners[0];listener_count=$owners.Count;new_cmd=$op.CommandLine}|ConvertTo-Json -Compress"
Directory: projects
Status: FAILED
Exit code: 1
Cancel Job Rerun Command Refresh
+ ... ion SilentlyContinue).Count -ne 0){throw 'DEV_PORT_NOT_FREED'};$py=(G ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (DEV_PORT_NOT_FREED:String) [], RuntimeException
+ FullyQualifiedErrorId : DEV_PORT_NOT_FREED
---
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (DEV_PORT_NOT_FREED:String) [], RuntimeException
+ FullyQualifiedErrorId : DEV_PORT_NOT_FREED
---DEV_PORT_NOT_FREED
At line:1 char:909
+ ... ion SilentlyContinue).Count -ne 0){throw 'DEV_PORT_NOT_FREED'};$py=(G ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationStopped: (DEV_PORT_NOT_FREED:String) [], RuntimeException
+ FullyQualifiedErrorId : DEV_PORT_NOT_FREED