Skip to content

The agent that grows with you

fix(config): the v52 step names the browser.backend value it removed and why

Teknium5fb0111928df
diff --git a/hermes_cli/config_migrations_browser.py b/hermes_cli/config_migrations_browser.py
index 98e5efce744..66cfcc3e675 100644
--- a/hermes_cli/config_migrations_browser.py
+++ b/hermes_cli/config_migrations_browser.py
@@ -78,6 +78,26 @@ def _config_decided(key: str, current: Any) -> bool:
return current not in (None, "", [])
+# browser.backend chose Browser Use mode (browser_exec) or the built-in browser_* tools; any value but
+# ``browser-use`` meant the built-in tools, on whatever browser the value named.
+_BACKEND_REASONS = {
+ "browser-use": "browser_exec (Browser Use mode) is the only browser now",
+ "agent-browser": "agent-browser left Hermes; browser_exec is the browser now",
+ "camofox": "Camofox is now the camofox plugin (`hermes plugins install camofox`)",
+ "local": "browser_exec launches Hermes's packaged Chromium itself (browser.cloud_provider: local)",
+ **dict.fromkeys(("browserbase", "firecrawl", "nous"),
+ "a cloud browser is chosen with browser.cloud_provider (`hermes tools` → Browser Automation)"),
+}
+
+
+def _backend_removed_note(backend: Any) -> str:
+ value = "" if backend is None or isinstance(backend, bool) else str(backend).strip()
+ if not value:
+ return "removed browser.backend (unset)"
+ reason = _BACKEND_REASONS.get(value.lower(), "browser_exec is the only browser now")
+ return f"removed browser.backend: {value} — {reason}"
+
+
def migrate_to_52(results: dict[str, Any], quiet: bool) -> None:
# 51 -> 52: agent-browser and the built-in browser_* tools left Hermes; browser_exec is the only
# browser. `browser.backend` chose between the two, so it is dropped (an `off`, the opt-out of
@@ -108,7 +128,7 @@ def migrate_to_52(results: dict[str, Any], quiet: bool) -> None:
messages.append(f" ✓ {note[0].upper()}{note[1:]}.")
notices.append(f"{note[0].upper()}{note[1:]}.")
else:
- added.append("removed browser.backend")
+ added.append(_backend_removed_note(backend))
if "extension_control" in browser:
browser.pop("extension_control")
added.append("removed browser.extension_control")
diff --git a/tests/hermes_cli/test_config_migration_52_browser.py b/tests/hermes_cli/test_config_migration_52_browser.py
index 6c9dee326ba..8d130baa583 100644
--- a/tests/hermes_cli/test_config_migration_52_browser.py
+++ b/tests/hermes_cli/test_config_migration_52_browser.py
@@ -94,6 +94,23 @@ def test_boot_migration_shows_the_off_notice_at_the_first_agent_start_once(tmp_p
assert _boot_agents(home, monkeypatch, starts=1) == []
[email protected](("value", "reason"), [
+ ("camofox", "Camofox is now the camofox plugin (`hermes plugins install camofox`)"),
+ ("local", "browser_exec launches Hermes's packaged Chromium itself"),
+ ("browserbase", "a cloud browser is chosen with browser.cloud_provider"),
+ ("Browser-Use", "browser_exec (Browser Use mode) is the only browser now"),
+ ("agent-browser", "agent-browser left Hermes"),
+ ("lynx", "browser_exec is the only browser now"),
+])
+def test_a_removed_backend_value_is_named_with_its_reason(tmp_path, monkeypatch, value, reason):
+ monkeypatch.setenv("HERMES_HOME", str(tmp_path / "launch"))
+ home = _home(tmp_path / "a", {"_config_version": 51, "browser": {"backend": value}})
+ results = _migrate(home, quiet=True)
+ assert "backend" not in _raw(home)["browser"]
+ note = next(note for note in results["config_added"] if "browser.backend" in note)
+ assert note.startswith(f"removed browser.backend: {value} — ") and reason in note
+
+
@pytest.mark.parametrize("value", ["", "browser-use", "Browser-Use", None])
def test_other_backend_values_are_dropped_silently(tmp_path, monkeypatch, capsys, value):
monkeypatch.setenv("HERMES_HOME", str(tmp_path / "launch"))