simplify(compat): tools/browser_tool — drop the last warm_agent_browser_npx_cache re-export, repoint 1 caller (update_cmd_deps internal import) + 1 test file
Consolidates on top of the concurrent browser_tool compat-removal commits (de60f789a7,912a497ce2,da7ee6353e,69eb1feb3e): the facade no longer re-exports any browser_tool_* sibling name; hermes_cli/update_cmd_deps.py's internal import (not its exported surface) and tests/hermes_cli/test_cmd_update.py patch targets now point at tools.browser_tool_install.
This commit is contained in:
@@ -584,7 +584,7 @@ def _update_node_dependencies() -> list[str]:
|
||||
# See #43564.
|
||||
print("→ Warming npx cache for agent-browser...")
|
||||
with suppress(Exception):
|
||||
from tools.browser_tool import warm_agent_browser_npx_cache
|
||||
from tools.browser_tool_install import warm_agent_browser_npx_cache
|
||||
warm_agent_browser_npx_cache()
|
||||
|
||||
if not _m()._npm_lockfile_changed(shared_hermes_root):
|
||||
|
||||
@@ -1078,7 +1078,7 @@ class TestNodeRuntimeNpmResolution:
|
||||
)
|
||||
|
||||
with patch(
|
||||
"tools.browser_tool.warm_agent_browser_npx_cache", return_value=True
|
||||
"tools.browser_tool_install.warm_agent_browser_npx_cache", return_value=True
|
||||
):
|
||||
failed = hm._update_node_dependencies()
|
||||
assert failed == ["ui-tui, web workspaces"]
|
||||
@@ -1280,7 +1280,7 @@ class TestUpdateNodeDependencies:
|
||||
"""The npx cache warm-up is covered by its own dedicated test below;
|
||||
stub it out everywhere else so it doesn't add a spurious npm/npx
|
||||
call to the workspace-install assertions in this class."""
|
||||
with patch("tools.browser_tool.warm_agent_browser_npx_cache", return_value=True):
|
||||
with patch("tools.browser_tool_install.warm_agent_browser_npx_cache", return_value=True):
|
||||
yield
|
||||
|
||||
def _npm_calls(self, mock_run):
|
||||
@@ -1468,7 +1468,7 @@ class TestUpdateNodeDependencies:
|
||||
mock_popen.side_effect = self._make_popen([], returncode=1, stderr_lines=["npm ERR!\n"])
|
||||
|
||||
with patch(
|
||||
"tools.browser_tool.warm_agent_browser_npx_cache", return_value=True
|
||||
"tools.browser_tool_install.warm_agent_browser_npx_cache", return_value=True
|
||||
) as mock_warm:
|
||||
hm._update_node_dependencies()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user