From c402bcf1d8d62d0da71cd707a06f3cab52c8d024 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Wed, 9 Sep 2026 12:31:30 +0530 Subject: [PATCH] fix(profiles): a stored /profiles/ home names its profile even when the root carries no markers CI: tests/test_tui_gateway_server.py::test_ensure_session_db_row_stamps_profile_name used a bare tmp root; profile_name_for_home fell through to None and the row was stamped default. The stored home is authoritative (its owner resolved it), so the profiles/ shape is sufficient. --- hermes_constants.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hermes_constants.py b/hermes_constants.py index 21dda94ba5..96d8331244 100644 --- a/hermes_constants.py +++ b/hermes_constants.py @@ -223,6 +223,10 @@ def profile_name_for_home(path: str | Path | None) -> str | None: named = named_profile_home(candidate) if named is not None: return named.name + # A stored profile home is authoritative: its owner already resolved it, so the + # /profiles/ shape names the profile even when carries no markers. + if candidate.parent.name == "profiles" and not candidate.name.startswith("."): + return candidate.name except (OSError, RuntimeError, ValueError): return None return None