fix(config): migrate stale HERMES_DASHBOARD_SESSION_TOKEN from .env (v30) - #39652
fix(config): migrate stale HERMES_DASHBOARD_SESSION_TOKEN from .env (v30)#396521RB wants to merge 1 commit into
Conversation
eb96437 to
91f2acb
Compare
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR bumps the Hermes CLI config schema version and adds a migration step to remove a now-obsolete dashboard session token from the user’s .env.
Changes:
- Bump
_config_versionfrom 26 to 27. - Add a 26→27 migration that clears
HERMES_DASHBOARD_SESSION_TOKENin~/.hermes/.env.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
91f2acb to
ce17e3f
Compare
f50dc5f to
053d0ca
Compare
053d0ca to
e057817
Compare
3ba37c2 to
374409a
Compare
…v30) Remote mode now uses username/password auth; local mode auto-generates tokens per boot. A stale pinned token in .env breaks Desktop LOCAL mode because python-dotenv with override=True clobbers the fresh per-boot token, causing immediate 401 auth failures. Follows the same ANTHROPIC_TOKEN cleanup pattern. Fixes NousResearch#38575.
374409a to
46df61d
Compare
|
Thanks for tracing the stale-token failure mode and for addressing the earlier review feedback around full removal and diagnostics. This is an automated hermes-sweeper review. Current
Closing as implemented on main because the proposed migration is no longer needed to prevent the stated boot-loop/401 outcome. |
What does this PR do?
Automatically removes stale
HERMES_DASHBOARD_SESSION_TOKENfrom~/.hermes/.envduring config migration (version 30). The previous docs recommended pinning this token for remote mode; current docs use username/password auth. Users who set up remote mode under the old docs still have a stale pinned token that breaks Desktop LOCAL mode: the Desktop app generates a fresh random token per boot, thenpython-dotenvwithoverride=Trueclobbers it with the stale pinned one, causing immediate 401 auth failures and a boot loop.This fix removes the root cause (the legacy
.enventry) rather than adding runtime workarounds toenv_loader.py.Related Issue
Fixes #38575
Supersedes #38586 (runtime token preservation approach gated on
HERMES_DASHBOARD_TUI == "1", never set in production)Type of Change
Changes Made
hermes_cli/config.py:_config_version29 → 30if current_ver < 30:that unconditionally callsremove_env_value("HERMES_DASHBOARD_SESSION_TOKEN")remove_env_value()instead ofsave_env_value(key, "")to fully delete the key (not leave an empty string)How to Test
HERMES_DASHBOARD_SESSION_TOKEN=*** to~/.hermes/.env`hermes update(or any command that triggers config migration)HERMES_DASHBOARD_SESSION_TOKENis removed from.envhermes desktop(local mode) starts without 401 errorsChecklist
fix(config):)ANTHROPIC_TOKENmigration which also has no dedicated tests; migration logic is implicitly exercised by everyhermes updatecall)