Skip to content

The agent that grows with you

fix(profile): point the empty-alias dead end at hermes doctor

dlcsouza5ddcac5ac383
diff --git a/hermes_cli/profile_cmd.py b/hermes_cli/profile_cmd.py
index cab4b50fe46..c13b1c09915 100644
--- a/hermes_cli/profile_cmd.py
+++ b/hermes_cli/profile_cmd.py
@@ -425,6 +425,10 @@ def _profile_alias(args):
print(f"✓ Removed alias '{alias_name}'")
else:
print(f"No alias '{alias_name}' found to remove.")
+ print(
+ " Tip: run `hermes doctor` -- its \"Orphan alias\" section lists "
+ "wrapper/profile mismatches, including wrappers whose profile is gone."
+ )
return
if not profile_exists(name):
_die(f"Error: Profile '{name}' does not exist.")
diff --git a/tests/hermes_cli/test_profile_alias_orphan_removal.py b/tests/hermes_cli/test_profile_alias_orphan_removal.py
index 9d0a3fbbefe..7e7d86f0211 100644
--- a/tests/hermes_cli/test_profile_alias_orphan_removal.py
+++ b/tests/hermes_cli/test_profile_alias_orphan_removal.py
@@ -47,7 +47,7 @@ def test_remove_alias_whose_profile_is_gone(isolated_home, capsys):
assert "Removed alias 'petcare'" in capsys.readouterr().out
-def test_remove_never_unlinks_a_file_that_is_not_a_wrapper(isolated_home):
+def test_remove_never_unlinks_a_file_that_is_not_a_wrapper(isolated_home, capsys):
"""Dropping the profile check is safe only because removal stays name- and
content-guarded: it refuses a traversal-shaped name and only unlinks a file
that reads as a Hermes wrapper."""
@@ -60,6 +60,9 @@ def test_remove_never_unlinks_a_file_that_is_not_a_wrapper(isolated_home):
)
assert not_a_wrapper.exists()
+ # A dead end must point at the tool that surfaces these mismatches (#90983).
+ out = capsys.readouterr().out
+ assert "hermes doctor" in out and "Orphan alias" in out
def test_create_still_requires_an_existing_profile(isolated_home):