fix(install): skip browser download when system chromium exists

This commit is contained in:
helix4u 2026-05-13 18:37:06 -06:00 committed by Teknium
parent 7f08cb5941
commit 52521c937a
4 changed files with 173 additions and 54 deletions

View file

@ -3381,8 +3381,8 @@ def _chromium_installed() -> bool:
1. ``AGENT_BROWSER_EXECUTABLE_PATH`` env var the official way to point
agent-browser at a pre-installed Chrome/Chromium.
2. System Chrome/Chromium in PATH (``google-chrome``, ``chromium-browser``,
``chrome``).
2. System Chrome/Chromium in PATH (``google-chrome``, ``chromium``,
``chromium-browser``, ``chrome``).
3. Playwright's browser cache (current logic) — directories containing
``chromium-*`` or ``chromium_headless_shell-*``.
@ -3405,7 +3405,12 @@ def _chromium_installed() -> bool:
return True
# 2. System Chrome/Chromium in PATH (common names)
system_chrome = shutil.which("google-chrome") or shutil.which("chromium-browser") or shutil.which("chrome")
system_chrome = (
shutil.which("google-chrome")
or shutil.which("chromium")
or shutil.which("chromium-browser")
or shutil.which("chrome")
)
if system_chrome:
_cached_chromium_installed = True
return True