Skip to content

fix: resolve .env and config paths from ~/.hermes/, not project root#48

Merged
teknium1 merged 1 commit intoNousResearch:mainfrom
deankerr:fix/config-path-resolution
Feb 26, 2026
Merged

fix: resolve .env and config paths from ~/.hermes/, not project root#48
teknium1 merged 1 commit intoNousResearch:mainfrom
deankerr:fix/config-path-resolution

Conversation

@deankerr
Copy link
Copy Markdown
Contributor

Summary

  • .env and config.yaml are now loaded from ~/.hermes/ (HERMES_HOME) as the primary source, with the project root as a dev fallback
  • All entry points (main.py, run_agent.py, doctor.py) use consistent path resolution via hermes_cli.config utilities
  • status and doctor commands now report correct file locations and detect API keys from ~/.hermes/.env
  • Fixed doctor.py skills hub path, GitHub token detection, and missing_vars/env_vars key handling

Context

The install script places config at ~/.hermes/.env and ~/.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 in status/doctor and required users to duplicate their .env file.

Test plan

  • hermes status shows .env file: ✓ exists pointing to ~/.hermes/.env
  • hermes config shows correct paths under Paths section
  • hermes doctor detects API keys from ~/.hermes/.env
  • hermes chat loads API keys and gets a response
  • Dev fallback: works with .env in project root when ~/.hermes/.env doesn't exist

🤖 Generated with Claude Code

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>
@deankerr deankerr marked this pull request as ready for review February 26, 2026 06:27
@teknium1 teknium1 merged commit 53b3177 into NousResearch:main Feb 26, 2026
@teknium1
Copy link
Copy Markdown
Contributor

LGTM

@deankerr deankerr deleted the fix/config-path-resolution branch February 26, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants