Skip to content

The agent that grows with you

fix(doctor): say recreating the same Docker image does not fix npm findings

ethernetdee35e1d536a
diff --git a/hermes_cli/doctor_tools.py b/hermes_cli/doctor_tools.py
index 5a8fd87dafb..9bf1c383ac4 100644
--- a/hermes_cli/doctor_tools.py
+++ b/hermes_cli/doctor_tools.py
@@ -440,7 +440,6 @@ def _audit_one(npm_bin: str, npm_dir, label: str, audit_extra: list[str], manual
if total == 0:
check_ok(f"{label} deps", "(no known vulnerabilities)")
elif critical > 0 or high > 0:
- detail = "build-time tooling" if workspace_scoped else "runtime dependency tree"
remedy = ("fix is an upstream lockfile bump — a local manual fix does not persist"
" (the next `hermes update` reinstalls from the committed lockfile)")
check_warn(f"{label} deps", f"({critical} critical, {high} high, {moderate} moderate — {remedy})")
@@ -448,10 +447,10 @@ def _audit_one(npm_bin: str, npm_dir, label: str, audit_extra: list[str], manual
check_info(" ^ workspace audit includes runtime and build dependencies; if manual npm remediation "
"errors with an arborist crash it's a known npm bug — clears via a lockfile bump")
else:
- check_info(f" ^ {detail}; report/pin the fix in package-lock.json — see #116774")
+ check_info(" ^ runtime dependency tree; report/pin the fix in package-lock.json — see #116774")
manual_issues.append(
f"{label} has {total} npm {_plural(total)}; wait for an upstream lockfile fix, then update "
- "your installation (Docker: pull a rebuilt image)"
+ "your installation (Docker: pull a rebuilt image; recreating the same image restores the same dependencies)"
)
else:
check_ok(f"{label} deps", f"({moderate} moderate {_plural(moderate)})")
diff --git a/tests/hermes_cli/test_doctor_audit_remedy.py b/tests/hermes_cli/test_doctor_audit_remedy.py
index 5d79486af1e..b48fb2b9783 100644
--- a/tests/hermes_cli/test_doctor_audit_remedy.py
+++ b/tests/hermes_cli/test_doctor_audit_remedy.py
@@ -47,7 +47,7 @@ def test_root_remedy_never_prescribes_local_audit_fix(capsys):
assert "lockfile bump" in out
assert issues == [
"Browser tools (agent-browser) has 2 npm vulnerabilities; wait for an upstream lockfile fix, then update "
- "your installation (Docker: pull a rebuilt image)"
+ "your installation (Docker: pull a rebuilt image; recreating the same image restores the same dependencies)"
]
diff --git a/tests/hermes_cli/test_doctor_workspace_audit.py b/tests/hermes_cli/test_doctor_workspace_audit.py
index 9543afbad3d..0772ac77aeb 100644
--- a/tests/hermes_cli/test_doctor_workspace_audit.py
+++ b/tests/hermes_cli/test_doctor_workspace_audit.py
@@ -31,4 +31,5 @@ def test_workspace_runtime_findings_are_not_dismissed_as_build_tooling(workspace
assert "not runtime" not in output
assert "1 high, 1 moderate" in output
assert "upstream lockfile bump" in output
- assert issues == [f"{workspace} workspace has 2 npm vulnerabilities"]
+ assert len(issues) == 1
+ assert issues[0].startswith(f"{workspace} workspace has 2 npm vulnerabilities")