fix(cli): ignore stale missing profile homes at startup - #59554
Open
konsisumer wants to merge 1 commit into
Open
fix(cli): ignore stale missing profile homes at startup#59554konsisumer wants to merge 1 commit into
konsisumer wants to merge 1 commit into
Conversation
Contributor
|
Thanks for the focused startup-path fix. Current Automated hermes-sweeper review. |
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed and why
Per the reporter's clarification on July 6, 2026, the ghost-profile symptom was still reproducible on v0.18.0 and also showed up after rename. The concrete startup bug here was that Hermes trusted a stale
HERMES_HOMEpointing at.../profiles/<name>even after that profile directory had been deleted, so early startup work could recreate the missing profile beforeprofile listor the dashboard finished booting.This change updates
_apply_profile_override()to:HERMES_HOMEwhen it already points at a real profile directoryHERMES_HOMEwhen it points at a missing named-profile path, falling back to normal root/default resolution instead of reviving the profileactive_profileentry when that named profile no longer exists, instead of aborting or recreating itI also added regression coverage for both stale-startup cases so deleted/renamed profile paths do not come back just because Hermes starts.
How to test
pytest -q tests/hermes_cli/test_apply_profile_override.py tests/hermes_cli/test_apply_profile_override_missing_profile.py.HERMES_HOMEto a deleted~/.hermes/profiles/<name>path, runpython -m hermes_cli.main profile list, and confirm Hermes stays on the default profile and does not recreate the missing directory.~/.hermes/active_profile, runpython -m hermes_cli.main profile list, and confirm Hermes warns and does not recreateprofiles/<name>.What platforms tested on
Fixes #47368
Related: #45474