hermes - ✅(Solved) Fix [Bug]: `hermes status` misreports project .env and sessions with repo-local HERMES_HOME [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#14517Fetched 2026-04-24 06:16:49
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×3cross-referenced ×1

Error Message

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Fix Action

Fixed

PR fix notes

PR #14582: fix(cli): report project env and state sessions in status

Description (problem / solution / changelog)

What does this PR do?

Fixes hermes status diagnostics when Hermes is run with a repo-local HERMES_HOME.

Before this change, hermes doctor could correctly recognize a project-root .env fallback and a repo-local state.db, while hermes status still reported:

  • .env file: ✗ not found
  • Active: 0

This PR makes hermes status mirror the current storage/config reality more closely:

  • reports the project-root .env fallback when HERMES_HOME/.env is absent
  • reads stored session count from HERMES_HOME/state.db
  • keeps the legacy sessions/sessions.json fallback only when state.db is absent

Related Issue

Fixes #14517

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • hermes_cli/status.py
    • added explicit project .env fallback status reporting
    • added state.db session counting for the Sessions section
    • retained legacy sessions/sessions.json behavior when state.db is not present
  • tests/hermes_cli/test_status.py
    • added a regression test for repo-local HERMES_HOME + project .env + state.db session count

How to Test

  1. Create a repo-local HERMES_HOME containing state.db with sessions.
  2. Keep .env in the project root, not inside HERMES_HOME.
  3. Run HERMES_HOME=$PWD/.hermes-home python -m hermes_cli.main status.
  4. Confirm status reports the project .env fallback and the state.db session count.

Validation run locally:

scripts/run_tests.sh tests/hermes_cli/test_status.py tests/hermes_cli/test_status_model_provider.py tests/hermes_cli/test_env_loader.py -q
# 12 passed

git diff --check
# passed

Manual smoke check:

.env file:    ✓ exists (project directory fallback)
Stored:       1 session(s) (state.db)

Broader local check:

scripts/run_tests.sh tests/hermes_cli/ -q

This currently fails with 4 unrelated/pre-existing failures:

  • tests/hermes_cli/test_claw.py::TestCmdCleanup::test_dry_run_lists_dirs
  • tests/hermes_cli/test_claw.py::TestCmdCleanup::test_skips_when_user_declines
  • tests/hermes_cli/test_claw.py::TestCmdCleanup::test_shows_workspace_details
  • tests/hermes_cli/test_tips.py::TestTipsCorpus::test_max_length_reasonable

I reproduced the same 4 failures on a clean origin/main worktree, so they are not introduced by this PR.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Ubuntu 24.04.4 LTS aarch64

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

For New Skills

N/A

Screenshots / Logs

Relevant smoke output:

.env file:    ✓ exists (project directory fallback)
Stored:       1 session(s) (state.db)

Changed files

  • hermes_cli/status.py (modified, +51/-12)
  • tests/hermes_cli/test_status.py (modified, +37/-0)

Code Example

source .venv/bin/activate
  HERMES_HOME=$PWD/.hermes-home python -m hermes_cli.main doctor
  HERMES_HOME=$PWD/.hermes-home python -m hermes_cli.main status

### Expected Behavior

  status should use the same env/session resolution as doctor, or at least clearly report:

  - project .env fallback is active
  - sessions exist in repo-local state.db

### Actual Behavior

doctor reports:

  - project .env exists
  - repo-local .hermes-home/config.yaml exists
  - repo-local .hermes-home/state.db exists with 30 sessions
  - OpenAI Codex auth logged in

  status reports:

  - .env file: ✗ not found
  - Sessions: Active: 0

### Affected Component

CLI (interactive chat)

### Messaging Platform (if gateway-related)

_No response_

### Debug Report

---

Correction: the uploaded `hermes debug share` links appear to have been generated without the repo-local `HERMES_HOME`.

  They show:

---
RAW_BUFFERClick to expand / collapse

Bug Description

Bug

When running Hermes with a repo-local HERMES_HOME, hermes doctor resolves the setup correctly, but hermes status reports stale/wrong diagnostics.

Environment

  • Hermes: v0.10.0 (2026.4.16), current main after hermes update
  • git describe: v2026.4.16-1141-g51c1d2de
  • Python: 3.11.13
  • OS: Linux / WSL
  • HERMES_HOME=$PWD/.hermes-home
  • project .env exists in repo root
  • .hermes-home/state.db exists and contains sessions

Steps to Reproduce

 source .venv/bin/activate
 HERMES_HOME=$PWD/.hermes-home python -m hermes_cli.main doctor
 HERMES_HOME=$PWD/.hermes-home python -m hermes_cli.main status

### Expected Behavior

 status should use the same env/session resolution as doctor, or at least clearly report:

 - project .env fallback is active
 - sessions exist in repo-local state.db

### Actual Behavior

doctor reports:

 - project .env exists
 - repo-local .hermes-home/config.yaml exists
 - repo-local .hermes-home/state.db exists with 30 sessions
 - OpenAI Codex auth logged in

 status reports:

 - .env file: ✗ not found
 - Sessions: Active: 0

### Affected Component

CLI (interactive chat)

### Messaging Platform (if gateway-related)

_No response_

### Debug Report

```shell
Report     https://paste.rs/eLiyr
agent.log  https://paste.rs/dMj3i

Correction: the uploaded hermes debug share links appear to have been generated without the repo-local HERMES_HOME.

They show:

hermes_home: ~/.hermes
model: (not set)
provider: (auto)

The affected workspace is actually run with:

HERMES_HOME=$PWD/.hermes-home

When generated correctly, debug output shows:

hermes_home: ~/dev_projects/ai_tests/hermes-agent/.hermes-home
model: gpt-5.4
provider: openai-codex

So please treat the uploaded debug links as possibly not representative of the repo-local setup.

### Operating System
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64
(Ubuntu 24.04.3 LTS)

### Python Version

3.11.13

### Hermes Version

v0.10.0 (2026.4.16)

### Additional Logs / Traceback (optional)

```shell

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

Suspected Cause

status appears to check ${HERMES_HOME}/.env only for env-file presence, while doctor correctly detects the project .env fallback.

For sessions, status appears to check ${HERMES_HOME}/sessions/sessions.json, while current session truth is in ${HERMES_HOME}/state.db.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue can be fixed by ensuring hermes status correctly resolves the environment and sessions, potentially by updating the code to check for the project .env fallback and sessions in ${HERMES_HOME}/state.db.

Guidance

  • Verify that the HERMES_HOME environment variable is correctly set to the repo-local directory ($PWD/.hermes-home) when running hermes status.
  • Check the code for hermes status to ensure it correctly checks for the project .env fallback, rather than only checking ${HERMES_HOME}/.env.
  • Update the hermes status code to retrieve session information from ${HERMES_HOME}/state.db, rather than ${HERMES_HOME}/sessions/sessions.json.
  • Review the debug reports to ensure they are generated with the correct HERMES_HOME setting.

Notes

The provided debug links may not be representative of the repo-local setup, so it's essential to generate new debug reports with the correct HERMES_HOME setting.

Recommendation

Apply workaround: update the hermes status code to correctly resolve the environment and sessions, as the suspected cause suggests a code issue rather than a version problem.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - ✅(Solved) Fix [Bug]: `hermes status` misreports project .env and sessions with repo-local HERMES_HOME [1 pull requests, 1 participants]