Active
Project:
AI Playwright
Version:
1.0.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
7 Jul 2026 at 09:39 UTC
Updated:
7 Jul 2026 at 09:42 UTC
Jump to comment: Most recent
The browser_preview AI Agent tool (backed by scripts/browser-capture.mjs and src/PlaywrightRunner.php) leaks resources on error paths:
scripts/browser-capture.mjs catches errors and calls fail(), which runs process.exit(0). This does NOT unwind the surrounding finally { browser.close() }, so the headless Chromium process is orphaned on every error path (navigation timeout, bad page, screenshot failure). Under load this leaks browser processes.PlaywrightRunner::capture() only unlinks the temporary screenshot PNG on the success path. A non-zero/timed-out Node run, or an ok=false JSON result, leaves the temp PNG in the temp directory forever — an unbounded temp-directory leak.browser_preview AI Agent tool against a URL that times out or errors repeatedly.chromium/headless_shell processes accumulating (e.g. ps aux | grep headless_shell)./tmp/ai_playwright_*.png temp screenshot files accumulating and never being cleaned up.scripts/browser-capture.mjs, close the browser in the catch block before calling fail(), so process.exit(0) never bypasses browser cleanup.src/PlaywrightRunner.php, unlink the temp screenshot file on every exit path of capture() (success, non-zero/timed-out process, and ok=false JSON result), not only the success path.Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments