Summary
The Copilot desktop app sets __COMPAT_LAYER=DetectorsAppHealth in its process environment. This Windows Application Compatibility shim is inherited by all child processes (including the agent shell). When Microsoft Edge is launched from the Copilot shell (via Puppeteer, Playwright, or direct spawn), Edge's msedge.exe launcher process exits immediately with code 0, breaking all browser automation.
Chrome/Chromium's bundled exe is NOT affected.
Min Repro
From the Copilot agent shell:
# This FAILS because __COMPAT_LAYER=DetectorsAppHealth is inherited
node -e "require('puppeteer-core').launch({executablePath:'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe',headless:true}).then(b=>{console.log('OK');b.close()}).catch(e=>console.error('FAIL:',e.message.substring(0,200)))"
# Output: FAIL: Failed to launch the browser process: Code: 0
# This WORKS after clearing the env var
$env:__COMPAT_LAYER = $null
# Same command -> Output: OK
Environment
- OS: Windows 11 Enterprise (10.0.26200)
- Edge: 149.0.4022.80
- Copilot CLI: 1.0.64-0
- Node.js: v24.8.0
- Puppeteer: 25.1.0
Root Cause
__COMPAT_LAYER=DetectorsAppHealth propagates through:
github.exe -> copilot.exe -> pwsh.exe -> node.exe -> msedge.exe
When Edge inherits this shim, its launcher process exits immediately (code 0, ~90ms) instead of staying alive. Child browser processes DO run (port is reachable), but the parent exit causes Puppeteer/Playwright to treat it as a launch failure.
Suggested Fix
- Don't set
__COMPAT_LAYER for the shell/child processes
- Clear it before spawning the agent shell
- Or document this as a known limitation
Impact
Any agent task that needs to launch Edge (e2e tests, Puppeteer scripts, Playwright tests) fails from the Copilot shell.
Workaround
$env:__COMPAT_LAYER = $null
or in Node.js:
delete process.env.__COMPAT_LAYER;
Summary
The Copilot desktop app sets
__COMPAT_LAYER=DetectorsAppHealthin its process environment. This Windows Application Compatibility shim is inherited by all child processes (including the agent shell). When Microsoft Edge is launched from the Copilot shell (via Puppeteer, Playwright, or direct spawn), Edge'smsedge.exelauncher process exits immediately with code 0, breaking all browser automation.Chrome/Chromium's bundled exe is NOT affected.
Min Repro
From the Copilot agent shell:
Environment
Root Cause
__COMPAT_LAYER=DetectorsAppHealthpropagates through:github.exe -> copilot.exe -> pwsh.exe -> node.exe -> msedge.exeWhen Edge inherits this shim, its launcher process exits immediately (code 0, ~90ms) instead of staying alive. Child browser processes DO run (port is reachable), but the parent exit causes Puppeteer/Playwright to treat it as a launch failure.
Suggested Fix
__COMPAT_LAYERfor the shell/child processesImpact
Any agent task that needs to launch Edge (e2e tests, Puppeteer scripts, Playwright tests) fails from the Copilot shell.
Workaround
or in Node.js: