From 96128b0673d34bb417c6e0d3aeed64332e1c58d6 Mon Sep 17 00:00:00 2001 From: joaomarcos Date: Mon, 7 Sep 2026 16:42:01 -0300 Subject: [PATCH] fix(tui): preserve names for custom profile homes --- hermes_constants.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hermes_constants.py b/hermes_constants.py index 9b9ee3c785..62d4052fb1 100644 --- a/hermes_constants.py +++ b/hermes_constants.py @@ -221,7 +221,14 @@ def profile_name_for_home(path: str | Path | None) -> str | None: named = named_profile_home(current) except (OSError, RuntimeError, ValueError): return None - return named.name if named is not None else None + if named is not None: + return named.name + # Session records already carry a validated profile home. Preserve the + # established basename behavior for isolated test/custom roots whose + # parent is the conventional profiles directory but lacks root markers. + if current.parent.name == "profiles" and current.name and not current.name.startswith("."): + return current.name + return None def profile_tombstone_path(profile_home: Path) -> Path: