Skip to content

The agent that grows with you

install: --skip-browser / -SkipBrowser become PM's persisted opt-out

ethernet90963a6f749c
diff --git a/scripts/install.ps1 b/scripts/install.ps1
index e45d6e1be62..056286f14b4 100644
--- a/scripts/install.ps1
+++ b/scripts/install.ps1
@@ -6,6 +6,10 @@
# -NonInteractive skip stages that need input
# -IncludeDesktop add the desktop build stage
# -ProtocolVersion print the stage protocol version
+# -SkipBrowser do not install the browser tools (agent-browser +
+# Chromium); remembered by later installs and
+# `hermes update`, undone by
+# `hermes pm install agent-browser`
# -Verbose stream every child command's output (the default
# with redirected output and in CI)
[CmdletBinding(PositionalBinding=$false)]
@@ -20,6 +24,10 @@ param(
[switch]$NonInteractive,
[switch]$Json,
[switch]$IncludeDesktop,
+ # Same opt-out as install.sh --skip-browser: PM records it, so later
+ # installs and `hermes update` keep the browser tools off until
+ # `hermes pm install agent-browser` opts back in.
+ [switch]$SkipBrowser,
# Print the paths this install would use, as JSON on stdout, and exit
# without touching anything. The first question on any "installer says a
# path doesn't exist" report is which paths it actually resolved --
@@ -909,7 +917,11 @@ function Invoke-BootstrapPm {
Push-Location $InstallDir
try {
# Finish bootstrap uv before PM replaces or cleans its store entry.
- Invoke-Logged "Installing dependencies (hash-verified via uv.lock)" { & $bootPy -m pm.cli install }
+ # Bare $SkipBrowser, like $InstallDir: under iex/scriptblock entry the
+ # param() binding is not in $script: scope (see Initialize-ResolvedPaths).
+ $pmArgs = @('install')
+ if ($SkipBrowser) { $pmArgs += @('--without', 'agent-browser') }
+ Invoke-Logged "Installing dependencies (hash-verified via uv.lock)" { & $bootPy -m pm.cli @pmArgs }
if ($LASTEXITCODE) { Fail "dependency install failed" }
} finally {
Pop-Location
diff --git a/scripts/install.sh b/scripts/install.sh
index 99086976882..ecbd33e53a1 100755
--- a/scripts/install.sh
+++ b/scripts/install.sh
@@ -31,6 +31,7 @@ JSON=false
NON_INTERACTIVE=false
INCLUDE_DESKTOP=false
VERBOSE=false
+SKIP_BROWSER=false
while [ $# -gt 0 ]; do
case "$1" in
@@ -52,9 +53,7 @@ while [ $# -gt 0 ]; do
--json|-Json) JSON=true; shift ;;
--non-interactive|-NonInteractive) NON_INTERACTIVE=true; shift ;;
--skip-setup) NON_INTERACTIVE=true; shift ;;
- --skip-browser|--no-playwright)
- echo "$1 no longer skips the browser install; pm manages browser dependencies. Remove this flag and use --non-interactive to skip setup prompts." >&2
- exit 1 ;;
+ --skip-browser|--no-playwright|-SkipBrowser) SKIP_BROWSER=true; shift ;;
--include-desktop|-IncludeDesktop) INCLUDE_DESKTOP=true; shift ;;
--verbose|-Verbose) VERBOSE=true; shift ;;
-h|--help)
@@ -62,6 +61,11 @@ while [ $# -gt 0 ]; do
echo " [--hermes-home PATH]"
echo " [--manifest] [--stage NAME] [--json]"
echo " [--non-interactive] [--include-desktop] [--verbose]"
+ echo " [--skip-browser]"
+ echo
+ echo " --skip-browser Do not install the browser tools (agent-browser + Chromium)."
+ echo " Alias: --no-playwright. Remembered by later installs and"
+ echo " 'hermes update'; undo with 'hermes pm install agent-browser'."
exit 0 ;;
*) echo "unknown option: $1" >&2; exit 1 ;;
esac
@@ -587,9 +591,13 @@ bootstrap_python() {
# enters its independently locked runtime before mutating application deps.
bootstrap_pm() {
local boot_py
+ local pm_args=(install)
+ # PM records the opt-out, so later installs and `hermes update` keep the
+ # browser tools off until `hermes pm install agent-browser` opts back in.
+ [ "$SKIP_BROWSER" = true ] && pm_args+=(--without agent-browser)
bootstrap_python
(cd "$INSTALL_DIR" && run_logged "Installing dependencies (hash-verified via uv.lock)" \
- "$boot_py" -m pm.cli install) \
+ "$boot_py" -m pm.cli "${pm_args[@]}") \
|| fail "pm install failed"
log_success "dependencies installed"
}
diff --git a/tests/scripts/install/test_install_ps1_managed_python_provenance.py b/tests/scripts/install/test_install_ps1_managed_python_provenance.py
index 07aeffd4e60..bd521ec0f71 100644
--- a/tests/scripts/install/test_install_ps1_managed_python_provenance.py
+++ b/tests/scripts/install/test_install_ps1_managed_python_provenance.py
@@ -12,8 +12,12 @@ pytestmark = pytest.mark.platforms("windows")
INSTALLER = Path(__file__).resolve().parents[3] / "scripts" / "install.ps1"
[email protected]("stage,exit_code", [("venv", 0), ("python-deps", 0), ("python-deps", 17)])
-def test_python_stage_delegates_to_pin_without_touching_existing_env(tmp_path, stage, exit_code):
[email protected]("stage,exit_code,skip_browser", [
+ ("venv", 0, False), ("python-deps", 0, False), ("python-deps", 17, False),
+ # -SkipBrowser is PM's persisted opt-out, handed over as `--without`.
+ ("python-deps", 0, True),
+])
+def test_python_stage_delegates_to_pin_without_touching_existing_env(tmp_path, stage, exit_code, skip_browser):
powershell = shutil.which("powershell")
assert powershell
install = tmp_path / "install with spaces"
@@ -49,7 +53,9 @@ function uv {
} finally { Remove-Item $env:UV_BUSY }
}
function Invoke-WebRequest { throw 'network access outside test boundary' }
-. $Installer -InstallDir $InstallDir -HermesHome $HomeDir
+$installerArgs = @{ InstallDir = $InstallDir; HermesHome = $HomeDir }
+if ($env:PROBE_SKIP_BROWSER) { $installerArgs.SkipBrowser = $true }
+. $Installer @installerArgs
# Dot-sourcing defines Get-Uv, so override only that acquisition boundary.
function Get-Uv { return 'uv' }
Invoke-StageByName $env:PROBE_STAGE
@@ -59,6 +65,9 @@ exit $LASTEXITCODE
env = dict(os.environ, PROBE_STAGE=stage, PROBE_EXIT=str(exit_code), BOOTSTRAP_PYTHON=sys._base_executable,
PM_LOG=str(pm_log), UV_BUSY=str(tmp_path / "uv-busy"), PATHEXT=".COM;.EXE;.BAT;.CMD")
env.pop("PYTHONPATH", None)
+ env.pop("PROBE_SKIP_BROWSER", None)
+ if skip_browser:
+ env["PROBE_SKIP_BROWSER"] = "1"
run = subprocess.run([powershell, "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-File", str(wrapper),
"-Installer", str(INSTALLER), "-InstallDir", str(install), "-HomeDir", str(tmp_path / "home"), "-Log", str(log)],
cwd=tmp_path, env=env, stdin=subprocess.DEVNULL,
@@ -73,7 +82,8 @@ exit $LASTEXITCODE
["python", "find", "--managed-python", "--no-project", f"cpython-3.12-windows-{uv_arch}-none"],
]
if stage == "python-deps":
- assert json.loads(pm_log.read_text(encoding="utf-8-sig")) == ["install"]
+ assert json.loads(pm_log.read_text(encoding="utf-8-sig")) == (
+ ["install", "--without", "agent-browser"] if skip_browser else ["install"])
else:
assert not pm_log.exists()
assert existing.read_text(encoding="utf-8-sig") == "previous generation"
diff --git a/tests/scripts/install/test_install_sh_reuse_supported_python.py b/tests/scripts/install/test_install_sh_reuse_supported_python.py
index c063695ba0c..32ce4a3dd94 100644
--- a/tests/scripts/install/test_install_sh_reuse_supported_python.py
+++ b/tests/scripts/install/test_install_sh_reuse_supported_python.py
@@ -31,14 +31,30 @@ def test_missing_value_fails_before_any_install_work(option: str, suffix: list[s
assert not result.stdout
[email protected]("flag", ["--skip-browser", "--no-playwright"])
-def test_removed_browser_skip_never_becomes_noninteractive(flag: str) -> None:
- result = subprocess.run(["bash", str(INSTALL_SH), flag, "--manifest"],
- capture_output=True, text=True, timeout=10)
- assert result.returncode == 1
- assert "no longer skips the browser install" in result.stderr
- assert "--non-interactive" in result.stderr
- assert not result.stdout
[email protected]("flags, expected", [
+ ([], ["-m", "pm.cli", "install"]),
+ (["--skip-browser"], ["-m", "pm.cli", "install", "--without", "agent-browser"]),
+ (["--no-playwright"], ["-m", "pm.cli", "install", "--without", "agent-browser"]),
+])
+def test_browser_skip_becomes_the_pm_opt_out(tmp_path: Path, flags: list[str], expected: list[str]) -> None:
+ """The skip flag is PM's persisted opt-out, not a no-op and not --non-interactive."""
+ bash = shutil.which("bash")
+ assert bash
+ record = tmp_path / "pm-argv"
+ boot = tmp_path / "boot-python"
+ boot.write_text(f'#!{bash}\nprintf "%s\\n" "$@" > {shlex.quote(str(record))}\n', encoding="utf-8")
+ boot.chmod(0o755)
+ # Source the real script, replace only the interpreter acquisition, and run
+ # the real PM stage function.
+ script = ('source "$1" "${@:4}" --manifest; INSTALL_DIR="$2"; FIXTURE_PY="$3"; '
+ 'bootstrap_python() { boot_py="$FIXTURE_PY"; }; bootstrap_pm; '
+ 'printf "noninteractive=%s\\n" "$NON_INTERACTIVE"')
+ result = subprocess.run([bash, "-c", script, "test", str(INSTALL_SH), str(tmp_path), str(boot), *flags],
+ env={**os.environ, "HERMES_HOME": str(tmp_path / "home")},
+ capture_output=True, text=True, timeout=30)
+ assert result.returncode == 0, result.stdout + result.stderr
+ assert record.read_text(encoding="utf-8").splitlines() == expected
+ assert "noninteractive=false" in result.stdout
def _environment(tmp_path: Path) -> tuple[Path, Path, dict[str, str]]:
diff --git a/website/docs/getting-started/installation.md b/website/docs/getting-started/installation.md
index 7d2476d6810..29f41a40e63 100644
--- a/website/docs/getting-started/installation.md
+++ b/website/docs/getting-started/installation.md
@@ -68,7 +68,15 @@ The desktop/server scripts are not the Termux installation path.
The scripts clone the source, bootstrap uv, and delegate dependency preparation
to PM. PM provides pinned Python, Node.js, npm, ripgrep, and FFmpeg. The source
installation selects the `all` Python extra, not every optional extra.
-Browsers and other optional tools use their feature-specific installation paths.
+PM also installs the browser tools (`agent-browser` and its pinned Chromium) by
+default. If that download fails, the install still completes and prints the
+command to retry. Other optional tools use their feature-specific installation
+paths.
+
+To leave the browser tools out, pass `--skip-browser` on POSIX or `-SkipBrowser`
+on Windows. Hermes remembers this choice: later installs and `hermes update` do
+not add them back. Run `hermes pm install agent-browser` to install them and
+undo the choice.
The scripts create a launcher and prepare the data directory. Interactive runs
also invoke setup and gateway configuration. `--non-interactive` on POSIX, or
diff --git a/website/docs/user-guide/features/browser.md b/website/docs/user-guide/features/browser.md
index 1383392f209..bcd00d73b59 100644
--- a/website/docs/user-guide/features/browser.md
+++ b/website/docs/user-guide/features/browser.md
@@ -630,14 +630,20 @@ AGENT_BROWSER_ARGS=--no-sandbox
### Install agent-browser CLI
-You don't need to install anything — `agent-browser` resolves automatically via
-`npx agent-browser` on first browser-tool use. To avoid the one-time npx fetch,
-you can install it globally ahead of time (optional):
+The installers and `hermes update` install `agent-browser` and its pinned
+Chromium through Hermes's package manager by default. If you installed with
+`--skip-browser` / `-SkipBrowser`, or the download failed, install them with:
```bash
-npm install -g agent-browser
+hermes pm install agent-browser
```
+This also undoes an earlier `--skip-browser` choice, so updates keep the
+browser tools current. An `agent-browser` already on your `PATH` also works.
+On Linux, Chromium may also need system libraries
+(`npx playwright install-deps chromium`). On Android/Termux, run
+`npm install -g agent-browser && agent-browser install` instead.
+
:::info
The `browser` toolset must be included in your config's `toolsets` list or enabled via `hermes config set toolsets '["hermes-cli", "browser"]'`.
:::