mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-30 06:41:51 +00:00
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.
This commit is contained in:
parent
d3ffbc6409
commit
2a2cef4ac7
1 changed files with 15 additions and 2 deletions
17
cli.py
17
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 <profile>` 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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue