feat(profiles): rename any agent — the default profile gets a display name (#45624)

`hermes profile rename default <name>` (and the Desktop/dashboard rename
flows) now set a presentation-only `display_name` in profile.yaml instead
of erroring. The canonical id stays "default"; resolution, comparison,
and spawn paths are untouched. Named profiles keep real renames and their
display_name survives the move.

Surfaces: profile list/show/status, /profile (text only — data.profile
stays canonical), dashboard ProfilesPage, TUI-gateway profiles.list, and
Desktop (rail, switcher, Manage page, and the Bot Mode roster via a
displayName fallback so a renamed default shows its name, not "default").

Slimmer redo of the direction in PR #87760 by @yxssxn — thanks; see PR
body for what changed vs that approach.
This commit is contained in:
Teknium
2026-08-18 01:25:38 -07:00
parent 6abe6edee6
commit a1682376ca
22 changed files with 365 additions and 58 deletions
+16 -1
View File
@@ -100,8 +100,23 @@ def _exec_profile(ctx: CommandContext) -> CommandReply:
home_display = display_hermes_home()
# Presentation-only display name (profile.yaml). `data.profile` stays
# the canonical id — consumers route on it; only the text gets the label.
label = profile_name
try:
from hermes_cli.profiles import (
format_profile_label,
get_profile_dir,
read_profile_meta,
)
display = read_profile_meta(get_profile_dir(profile_name)).get("display_name", "")
label = format_profile_label(profile_name, display)
except Exception:
pass
return CommandReply(
f"Profile: {profile_name}\nHome: {home_display}",
f"Profile: {label}\nHome: {home_display}",
data={"profile": profile_name, "home": home_display},
)