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:
hermes profile create USER --clone
hermes profile use USER
hermes config get agent.name
Result: Correctly returns USER profile config. Profile switching works in CLI.
Test 2 - Gateway WebUI ❌ FAIL
Steps:
- After
hermes profile use USER
hermes gateway start
- Open Workspace WebUI
- Check system status or model
Result: WebUI shows Default profile config, not USER. Active profile is ignored.
Test 3 - Telegram ❌ FAIL
Steps:
- After
hermes profile use USER
- 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)
| Issue |
Title |
| #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 |
| #16264 |
Gateway runs in wrong context |
| #12099 |
build_session_key() hardcodes agent:main |
| #7663 |
SystemD 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
- Remove
HERMES_HOME from systemd/gateway startup
- Make
get_env_path() the single source of truth: read active_profile, resolve to profiles/NAME/, fall back to default
- Ensure Gateway calls
get_env_path() on every request (not cached at startup)
- Optionally:
hermes profile use could restart the gateway service via systemctl --user
Labels: type/bug area/gateway area/config
Bug Report: Profile switching is completely non-functional in the Hermes Gateway (Workspace WebUI, Telegram, and all non-CLI platforms).
Summary
hermes profile use NAMEworks 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:
hermes profile create USER --clonehermes profile use USERhermes config get agent.nameResult: Correctly returns USER profile config. Profile switching works in CLI.
Test 2 - Gateway WebUI ❌ FAIL
Steps:
hermes profile use USERhermes gateway startResult: WebUI shows Default profile config, not USER. Active profile is ignored.
Test 3 - Telegram ❌ FAIL
Steps:
hermes profile use USERResult: Bot responds with Default profile personality/config. USER profile not loaded.
Test 4 - systemd service overrides profile⚠️ CONFIRMED
Result:
/etc/systemd/system/hermes-gateway.servicecontains:Environment=HERMES_HOME=/root/.hermesThis 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)IfHERMES_HOMEis set (which systemd does), the function returns early at line ~70. It never checksactive_profile.(b)
hermes/gateway/main.py->_apply_profile_override()python if os.environ.get("HERMES_HOME"): return # already overridden, skip profileThis means any process started by systemd (gateway, webui, telegram) never reads~/.hermes/active_profile.Test 6 -
.envand profile separation ❌ BROKENThe
.envfile lives at/root/.hermes/.env, shared across all profiles. A profile cannot have its own API keys or environment variables.Related Issues (all open)
hermes profile usebroken after updatebuild_session_key()hardcodesagent:mainExpected 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_profileand adjustHERMES_HOMEaccordingly).Workaround (hack - not recommended)
Modify
get_env_path()to read~/.hermes/active_profileand re-deriveHERMES_HOMEfrom it, plus removeHERMES_HOMEfrom systemd. But this requires patching source code and re-deploying.Suggested Fix Architecture
HERMES_HOMEfrom systemd/gateway startupget_env_path()the single source of truth: readactive_profile, resolve toprofiles/NAME/, fall back to defaultget_env_path()on every request (not cached at startup)hermes profile usecould restart the gateway service viasystemctl --userLabels:
type/bugarea/gatewayarea/config