The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
perf(cli): add --prefer-offline to npm install during update (#39267)
Rod Boevbdcdde9ff607
diff --git a/hermes_cli/main.py b/hermes_cli/main.pyindex 98874824c19..cd9966cf8cf 100644--- a/hermes_cli/main.py+++ b/hermes_cli/main.py@@ -5710,7 +5710,7 @@ def _do_build_web_ui(web_dir: Path, *, fatal: bool = False) -> bool:return _run_npm_install_deterministic(npm,npm_cwd,- extra_args=(*npm_workspace_args, "--silent") if silent else npm_workspace_args,+ extra_args=(*npm_workspace_args, "--silent", "--prefer-offline") if silent else (*npm_workspace_args, "--prefer-offline"),env=build_env,)diff --git a/hermes_cli/update_cmd.py b/hermes_cli/update_cmd.pyindex 240bb0fc9b5..c9069b1b1a2 100644--- a/hermes_cli/update_cmd.py+++ b/hermes_cli/update_cmd.py@@ -2089,7 +2089,7 @@ def _update_node_dependencies() -> list[str]:print(" deps). Fix npm and re-run `hermes update`.")return list(labels)- extra_args = ["--no-fund", "--no-audit", "--progress=false"]+ extra_args = ["--no-fund", "--no-audit", "--prefer-offline", "--progress=false"]from hermes_constants import with_hermes_node_pathdiff --git a/tests/hermes_cli/test_web_ui_build.py b/tests/hermes_cli/test_web_ui_build.pyindex 6e736bb931d..e12e9050c6c 100644--- a/tests/hermes_cli/test_web_ui_build.py+++ b/tests/hermes_cli/test_web_ui_build.py@@ -150,7 +150,7 @@ class TestBuildWebUISkipsWhenFresh:assert result is Trueargs, kwargs = mock_run.call_argsassert "--workspace" not in args[0]- assert args[0] == ["/usr/bin/npm", "ci", "--include=dev", "--silent"]+ assert args[0] == ["/usr/bin/npm", "ci", "--include=dev", "--silent", "--prefer-offline"]assert kwargs["cwd"] == web_dirdef test_web_build_uses_idle_timeout_helper(self, tmp_path):