Skip to content

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

Merged
teknium1 merged 1 commit into
NousResearch: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 into
NousResearch: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
sudo-yf pushed a commit to sudo-yf/hermes-agent that referenced this pull request Apr 5, 2026
fix(ci): use standard version tags for GitHub Actions
angelburgosrosado pushed a commit to angelburgosrosado/hermes-agent that referenced this pull request Apr 27, 2026
…lution

fix: resolve .env and config paths from ~/.hermes/, not project root
olympus-terminal pushed a commit to olympus-terminal/hermes-agent that referenced this pull request May 16, 2026
…lution

fix: resolve .env and config paths from ~/.hermes/, not project root
teknium1 added a commit that referenced this pull request May 29, 2026
…kew) (#34475)

A process running mismatched module versions — conversation_compression.py
re-imported with the post-#34351 lock code while a long-lived
hermes_state.SessionDB stays bound to the pre-#34351 class in memory — has
the try_acquire_compression_lock call site but not the method. The
AttributeError it raises is NOT a sqlite3.Error, so the method's own
fail-open guard never runs; the exception escapes to the outer agent loop,
which prints the error and retries. Compression never succeeds, the token
count never drops, and the loop re-triggers compaction forever (the
'API call #47/#48/#49 ... has no attribute try_acquire_compression_lock'
spin a user hit after an update).

Wrap the lock acquire so any unexpected exception fails OPEN: skip locking
and proceed with compression. Skipping the lock risks a rare
concurrent-compression session fork; an infinite no-progress loop that never
compresses at all is strictly worse. The remediation hint in the log points
at the real fix (restart / hermes update to resync the stale module).

Also guards get_compression_lock_holder against the same skew.

Adds a regression test simulating the version skew (real SessionDB wrapped
so only the lock methods raise AttributeError) — asserts _compress_context
proceeds and rotates instead of raising.
KKT-OPT pushed a commit to KKT-OPT/hermes-agent that referenced this pull request May 31, 2026
…kew) (NousResearch#34475)

A process running mismatched module versions — conversation_compression.py
re-imported with the post-NousResearch#34351 lock code while a long-lived
hermes_state.SessionDB stays bound to the pre-NousResearch#34351 class in memory — has
the try_acquire_compression_lock call site but not the method. The
AttributeError it raises is NOT a sqlite3.Error, so the method's own
fail-open guard never runs; the exception escapes to the outer agent loop,
which prints the error and retries. Compression never succeeds, the token
count never drops, and the loop re-triggers compaction forever (the
'API call NousResearch#47/NousResearch#48/NousResearch#49 ... has no attribute try_acquire_compression_lock'
spin a user hit after an update).

Wrap the lock acquire so any unexpected exception fails OPEN: skip locking
and proceed with compression. Skipping the lock risks a rare
concurrent-compression session fork; an infinite no-progress loop that never
compresses at all is strictly worse. The remediation hint in the log points
at the real fix (restart / hermes update to resync the stale module).

Also guards get_compression_lock_holder against the same skew.

Adds a regression test simulating the version skew (real SessionDB wrapped
so only the lock methods raise AttributeError) — asserts _compress_context
proceeds and rotates instead of raising.
Benriez pushed a commit to Benriez/hermes-agent that referenced this pull request Jun 3, 2026
Adds reusable Kanban operator skill skeletons, Agent Garden as the first project adapter, deterministic workflow gate scripts, Hermes task JSON wrapper compatibility, and issue NousResearch#48 success examples.

Includes:
- kanban-card-spec
- kanban-review
- kanban-close-gate
- kanban-watch
- Agent Garden adapter
- adapter schema with Mac and Windows host support
- deterministic scripts for parent card validation, review evidence, close gate, and run health

Verified:
- prism-full available and used
- python3 -m py_compile passed
- script --help checks passed
- smoke-test compatibility gaps fixed
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
…lution

fix: resolve .env and config paths from ~/.hermes/, not project root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants