hermes - 💡(How to fix) Fix Profile switching fully broken in Gateway/WebUI/Telegram - HERMES_HOME guard blocks active_profile

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

hermes profile use NAME works perfectly in the CLI. New shell, new profile. But the Gateway, Workspace WebUI, and Telegram all ignore the active profile and always run as the Default profile.

Root Cause

Test 5 - Code inspection (Root Cause)

Fix Action

Fix / Workaround

Workaround (hack - not recommended)

Modify get_env_path() to read ~/.hermes/active_profile and re-derive HERMES_HOME from it, plus remove HERMES_HOME from systemd. But this requires patching source code and re-deploying.

Code Example

if env_home := os.environ.get("HERMES_HOME"):
    return Path(env_home)

---

if os.environ.get("HERMES_HOME"):
    return  # already overridden, skip profile
RAW_BUFFERClick to expand / collapse

Bug Report: Profile switching is completely non-functional in the Hermes Gateway (Workspace WebUI, Telegram, and all non-CLI platforms).

Summary

hermes profile use NAME works perfectly in the CLI. New shell, new profile. But the Gateway, Workspace WebUI, and Telegram all ignore the active profile and always run as the Default profile.

Test Protocol (Hermes v2.3.0)

Test 1 - CLI profile switching ✅ PASS

Steps:

  1. hermes profile create USER --clone
  2. hermes profile use USER
  3. hermes config get agent.name

Result: Correctly returns USER profile config. Profile switching works in CLI.


Test 2 - Gateway WebUI ❌ FAIL

Steps:

  1. After hermes profile use USER
  2. hermes gateway start
  3. Open Workspace WebUI
  4. Check system status or model

Result: WebUI shows Default profile config, not USER. Active profile is ignored.


Test 3 - Telegram ❌ FAIL

Steps:

  1. After hermes profile use USER
  2. Send message to Telegram bot

Result: Bot responds with Default profile personality/config. USER profile not loaded.


Test 4 - systemd service overrides profile ⚠️ CONFIRMED

Result: /etc/systemd/system/hermes-gateway.service contains:

Environment=HERMES_HOME=/root/.hermes

This is hardcoded and blocks profile switching.


Test 5 - Code inspection (Root Cause)

Two blocking code locations:

(a) hermes/core/prefixed_env.py -> get_env_path()python if env_home := os.environ.get("HERMES_HOME"): return Path(env_home) If HERMES_HOME is set (which systemd does), the function returns early at line ~70. It never checks active_profile.

(b) hermes/gateway/main.py -> _apply_profile_override()python if os.environ.get("HERMES_HOME"): return # already overridden, skip profile This means any process started by systemd (gateway, webui, telegram) never reads ~/.hermes/active_profile.


Test 6 - .env and profile separation ❌ BROKEN

The .env file lives at /root/.hermes/.env, shared across all profiles. A profile cannot have its own API keys or environment variables.

Related Issues (all open)

IssueTitle
#16582 (P2)WebUI sessions stored in wrong profile directory
#19299 (P2)hermes profile use broken after update
#19113 (P2)Gateway stores data in wrong home
#16264Gateway runs in wrong context
#12099build_session_key() hardcodes agent:main
#7663SystemD profile support request

Expected Behavior

Switching profiles in the CLI should also switch the profile used by the Gateway, WebUI, Telegram, and all other Hermes services. OR the profile system should be transparent to the Gateway (the Gateway should read active_profile and adjust HERMES_HOME accordingly).

Workaround (hack - not recommended)

Modify get_env_path() to read ~/.hermes/active_profile and re-derive HERMES_HOME from it, plus remove HERMES_HOME from systemd. But this requires patching source code and re-deploying.

Suggested Fix Architecture

  1. Remove HERMES_HOME from systemd/gateway startup
  2. Make get_env_path() the single source of truth: read active_profile, resolve to profiles/NAME/, fall back to default
  3. Ensure Gateway calls get_env_path() on every request (not cached at startup)
  4. Optionally: hermes profile use could restart the gateway service via systemctl --user

Labels: type/bug area/gateway area/config


Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix Profile switching fully broken in Gateway/WebUI/Telegram - HERMES_HOME guard blocks active_profile