fix(desktop): keep profile homes out of bootstrap (#46073)

This commit is contained in:
Teknium
2026-06-14 03:08:52 -07:00
committed by GitHub
parent afc8615509
commit 0428945b5b
5 changed files with 69 additions and 5 deletions
+8 -3
View File
@@ -1655,15 +1655,20 @@ def _setup_telegram_auto_result():
profile_name: str | None = None
try:
hermes_home = str(get_hermes_home())
if "/profiles/" in hermes_home:
profile_name = hermes_home.rstrip("/").rsplit("/", 1)[-1]
profile_name = _profile_name_from_hermes_home(Path(get_hermes_home()))
except Exception:
pass
return auto_setup_telegram_bot_result(profile_name=profile_name)
def _profile_name_from_hermes_home(hermes_home) -> str | None:
"""Return the active profile name when HERMES_HOME is a profile dir."""
if hermes_home.parent.name == "profiles":
return hermes_home.name
return None
def _setup_telegram_auto() -> str | None:
"""Attempt automatic Telegram bot creation and return only the token."""
result = _setup_telegram_auto_result()