From 2a2cef4ac7d4b2c9247369fe3f41b1ef6ffb6009 Mon Sep 17 00:00:00 2001 From: "CK iRonin.IT" Date: Mon, 25 May 2026 00:52:23 -0700 Subject: [PATCH] fix: include -p profile flag in exit resume hint Session IDs are profile-constrained, so the resume hint needs to include the active profile for multi-profile users. Without this, copying the hint from a non-default profile fails to resume the correct session. Before: hermes --resume 20260414_063228_c1240e After: hermes --resume 20260414_063228_c1240e -p dev Also includes -p on the resume-by-title hint. Skipped for 'default' and 'custom' profiles (no -p needed). Surgical reapply of PR #9652. Original branch was stale against current main (~6 months); reapplied onto current cli.py by hand with original authorship preserved. --- cli.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/cli.py b/cli.py index 759c09b4619..af3210f3cb9 100644 --- a/cli.py +++ b/cli.py @@ -11954,9 +11954,22 @@ class HermesCLI: pass print("Resume this session with:") - print(f" hermes --resume {self.session_id}") + # Session IDs are profile-constrained, so the resume hint must + # include `-p ` for non-default profiles. Without this, + # copying the hint from a non-default profile fails to find the + # session on the next invocation. The "default" and "custom" + # profile names use the standard HERMES_HOME, so no -p needed. + try: + from hermes_cli.profiles import get_active_profile_name + _active_profile = get_active_profile_name() + except Exception: + _active_profile = "default" + profile_flag = ( + "" if _active_profile in ("default", "custom") else f" -p {_active_profile}" + ) + print(f" hermes --resume {self.session_id}{profile_flag}") if session_title: - print(f" hermes -c \"{session_title}\"") + print(f" hermes -c \"{session_title}\"{profile_flag}") print() print(f"Session: {self.session_id}") if session_title: