From d695948d2ee862801207e0d07638421a0dc0ace1 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Tue, 6 Oct 2026 22:24:43 +0000 Subject: [PATCH] relay: app-shot-light uses its own Edge profile and waits for the headless browser (the first run handed off to the user's Edge and wrote nothing) Co-Authored-By: Claude Fable 5.1 --- relay/playbooks/app-shot-light.ps1 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/relay/playbooks/app-shot-light.ps1 b/relay/playbooks/app-shot-light.ps1 index a2fbcd52..35e1502d 100644 --- a/relay/playbooks/app-shot-light.ps1 +++ b/relay/playbooks/app-shot-light.ps1 @@ -9,9 +9,15 @@ $url = (Get-Content $urlFile -Raw).Trim() $edge = @("$env:ProgramFiles (x86)\Microsoft\Edge\Application\msedge.exe", "$env:ProgramFiles\Microsoft\Edge\Application\msedge.exe") | Where-Object { Test-Path $_ } | Select-Object -First 1 if (-not $edge) { Write-Host "ERROR: Edge not found"; exit 2 } $out = Join-Path $env:TEMP 'igneum-shots'; New-Item -ItemType Directory -Force -Path $out | Out-Null +# a profile of its own, or the launcher hands the request to the user's running Edge and returns at once with no file +# (run-20261006-222112 on PC 2: both shots missing in 0 s); -Wait holds until the headless browser exits +$profile = Join-Path $out 'profile'; New-Item -ItemType Directory -Force -Path $profile | Out-Null foreach ($page in @('overview', 'cards')) { $png = Join-Path $out "igneum-$page-light-1440.png" - & $edge --headless=new --disable-gpu --hide-scrollbars --window-size=1440,1000 --virtual-time-budget=6000 "--screenshot=$png" "$url?page=$page&visible=1" 2>$null | Out-Null - if (Test-Path $png) { Write-Host "RESULT shot=$page bytes=$((Get-Item $png).Length)"; & $env:RELAY_SEND -TaskId ([long]$env:RELAY_TASK_ID) -Title "app $page light" $png } else { Write-Host "RESULT shot=$page missing" } + if (Test-Path $png) { Remove-Item $png -Force } + $args = @('--headless=new', '--disable-gpu', '--hide-scrollbars', '--no-first-run', '--window-size=1440,1000', '--virtual-time-budget=8000', "--user-data-dir=$profile", "--screenshot=$png", "$url?page=$page&visible=1") + $p = Start-Process -FilePath $edge -ArgumentList $args -Wait -PassThru -WindowStyle Hidden + $tries = 0; while (-not (Test-Path $png) -and $tries -lt 20) { Start-Sleep -Milliseconds 500; $tries++ } + if (Test-Path $png) { Write-Host "RESULT shot=$page bytes=$((Get-Item $png).Length) edge_exit=$($p.ExitCode)"; & $env:RELAY_SEND -TaskId ([long]$env:RELAY_TASK_ID) -Title "app $page light" $png } else { Write-Host "RESULT shot=$page missing edge_exit=$($p.ExitCode)" } } exit 0