fix: resolve .env and config paths from ~/.hermes/, not project root#48
Merged
teknium1 merged 1 commit intoNousResearch:mainfrom Feb 26, 2026
Merged
Conversation
The `hermes` CLI entry point (hermes_cli/main.py) and the agent runner (run_agent.py) only loaded .env from the project installation directory. After the standard installer, code lives at ~/.hermes/hermes-agent/ but config lives at ~/.hermes/ — so the .env was never found. Aligns these entry points with the pattern already used by gateway/run.py and rl_cli.py: load ~/.hermes/.env first, fall back to project root .env for dev-mode compatibility. Also fixes: - status.py checking .env existence and API keys at PROJECT_ROOT - doctor.py KeyError on tool availability (missing_vars vs env_vars) - doctor.py checking logs/ and Skills Hub at PROJECT_ROOT instead of HERMES_HOME - doctor.py redundant logs/ check (already covered by subdirectory loop) - mini-swe-agent loading config from platformdirs default instead of ~/.hermes/ Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
LGTM |
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
.envandconfig.yamlare now loaded from~/.hermes/(HERMES_HOME) as the primary source, with the project root as a dev fallbackmain.py,run_agent.py,doctor.py) use consistent path resolution viahermes_cli.configutilitiesstatusanddoctorcommands now report correct file locations and detect API keys from~/.hermes/.envdoctor.pyskills hub path, GitHub token detection, andmissing_vars/env_varskey handlingContext
The install script places config at
~/.hermes/.envand~/.hermes/config.yaml, but the code was looking for them at the project root (~/.hermes/hermes-agent/.env). This caused API keys to appear missing instatus/doctorand required users to duplicate their.envfile.Test plan
hermes statusshows.env file: ✓ existspointing to~/.hermes/.envhermes configshows correct paths under Paths sectionhermes doctordetects API keys from~/.hermes/.envhermes chatloads API keys and gets a response.envin project root when~/.hermes/.envdoesn't exist🤖 Generated with Claude Code