fix(gateway): honor active_profile when HERMES_HOME is the default root#22506
Open
haimu0x wants to merge 4 commits into
Open
fix(gateway): honor active_profile when HERMES_HOME is the default root#22506haimu0x wants to merge 4 commits into
haimu0x wants to merge 4 commits into
Conversation
Share CLI profile bootstrap with gateway/run.py so systemd and -m startup resolve sticky active_profile while non-default HERMES_HOME still inherits for subprocess relaunches. Fixes NousResearch#22502.
…ytest - Post / update PR comment: continue-on-error (fork tokens cannot write to base repo). - apply_profile_env_override: skip implicit bootstrap when pytest already loaded; main forces skip off. - Cover pytest/gateway split in test_profile_env_bootstrap. Related to NousResearch#22502.
…respect-active-profile
Use base _thread_metadata_for_source in _deliver_media_from_response so unit tests can pass a dummy self. Prefer thin-table exact match over OpenRouter metadata for hy3-preview. Align topic/session and streaming Telegram media tests with current thread metadata. Assert restart drain reply via catalog; clear HERMES_LANGUAGE and reset i18n caches between tests.
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.
Summary
Gateway entrypoints that import
gateway/run.py(e.g.python -m gateway.run, systemd withHERMES_HOMEset to the canonical default root) never applied the same early profile bootstrap ashermes_cli/main.py, so stickyactive_profilewas ignored while the CLI worked.Changes
apply_profile_env_override()intohermes_cli/profile_env_bootstrap.py(explicit-p/--profilefirst; ifHERMES_HOMEis already set to a path other thanget_profile_dir("default"), keep it for subprocess inheritance; otherwise readactive_profileand resolve).gateway/run.pybefore the firstget_hermes_home()use.hermes_cli/main.pyto the same helper.tests/hermes_cli/test_profile_env_bootstrap.py.Verification
python -m pytest tests/hermes_cli/test_profile_env_bootstrap.py -q -n 0Fixes #22502