hermes - ✅(Solved) Fix Bug: Honcho client freezes ~/.honcho/config.json path at import time and ignores runtime HOME changes [2 pull requests]

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…

plugins/memory/honcho/client.py computes GLOBAL_CONFIG_PATH = Path.home() / ".honcho" / "config.json" at import time, and resolve_config_path() later falls back to that frozen path.

If HOME changes after import (common in isolated tests, subprocess sandboxes, or profile-switched environments), Honcho still resolves the global config under the old home directory.

Root Cause

plugins/memory/honcho/client.py computes GLOBAL_CONFIG_PATH = Path.home() / ".honcho" / "config.json" at import time, and resolve_config_path() later falls back to that frozen path.

If HOME changes after import (common in isolated tests, subprocess sandboxes, or profile-switched environments), Honcho still resolves the global config under the old home directory.

Fix Action

Fixed

PR fix notes

PR #13320: [BugFix] Fix Honcho HOME-aware config fallback

Description (problem / solution / changelog)

Fixes #13283

Summary

  • compute the shared ~/.honcho/config.json fallback from the current HOME at call time
  • add regression coverage for HOME changes after import
  • keep the existing Hermes-local and default-profile lookup order unchanged

Root Cause

GLOBAL_CONFIG_PATH captured Path.home() at import time, so later HOME overrides used by tests and isolated instances could still fall back to the original user's ~/.honcho/config.json.

Testing

  • source venv/bin/activate && python -m pytest tests/honcho_plugin/test_client.py -q
  • source venv/bin/activate && python -m pytest tests/hermes_cli/test_profiles.py -q
  • source venv/bin/activate && python -m pytest tests/ -q (fails in unrelated ACP/approval/browser/media/vision areas and missing optional extras in this checkout)

Changed files

  • plugins/memory/honcho/client.py (modified, +6/-2)
  • tests/honcho_plugin/test_client.py (modified, +14/-3)

PR #13323: fix(honcho): resolve global config path at runtime

Description (problem / solution / changelog)

Summary

  • Fixes #13283
  • Resolves the global Honcho config path at call time instead of freezing Path.home() at import time
  • Preserves GLOBAL_CONFIG_PATH as a compatibility snapshot for existing imports

Root Cause

GLOBAL_CONFIG_PATH was computed during module import, so tests or runtime environments that changed HOME later still fell back to the old home directory.

Tests

  • uv run --frozen --python 3.11 --extra dev pytest -o addopts='' tests/honcho_plugin/test_client.py -q (70 passed, 3 skipped)
  • git diff --check -- plugins/memory/honcho/client.py tests/honcho_plugin/test_client.py

Changed files

  • plugins/memory/honcho/client.py (modified, +6/-1)
  • tests/honcho_plugin/test_client.py (modified, +16/-2)

Code Example

cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
python - <<'PY'
import os, tempfile
from pathlib import Path
from plugins.memory.honcho.client import resolve_config_path
orig = os.environ.get('HOME')
with tempfile.TemporaryDirectory() as td:
    os.environ['HOME'] = td
    print('runtime_home', Path.home())
    print('resolved', resolve_config_path())
if orig is not None:
    os.environ['HOME'] = orig
PY

---

runtime_home /var/.../tmp...
resolved /Users/genie/.honcho/config.json
RAW_BUFFERClick to expand / collapse

Summary

plugins/memory/honcho/client.py computes GLOBAL_CONFIG_PATH = Path.home() / ".honcho" / "config.json" at import time, and resolve_config_path() later falls back to that frozen path.

If HOME changes after import (common in isolated tests, subprocess sandboxes, or profile-switched environments), Honcho still resolves the global config under the old home directory.

Affected files

  • plugins/memory/honcho/client.py:30
  • plugins/memory/honcho/client.py:56-75
  • related test masking the behavior: tests/honcho_plugin/test_client.py:297-329

Why this is a bug

The code advertises dynamic resolution order with ~/.honcho/config.json as the final fallback, but the actual fallback is captured once at import time. That makes runtime home isolation ineffective.

Minimal reproduction

cd /Users/genie/.hermes/hermes-agent
source venv/bin/activate
python - <<'PY'
import os, tempfile
from pathlib import Path
from plugins.memory.honcho.client import resolve_config_path
orig = os.environ.get('HOME')
with tempfile.TemporaryDirectory() as td:
    os.environ['HOME'] = td
    print('runtime_home', Path.home())
    print('resolved', resolve_config_path())
if orig is not None:
    os.environ['HOME'] = orig
PY

Observed output:

runtime_home /var/.../tmp...
resolved /Users/genie/.honcho/config.json

Expected behavior

When HOME changes and neither $HERMES_HOME/honcho.json nor ~/.hermes/honcho.json exists, resolve_config_path() should resolve to the current runtime home, e.g. <runtime HOME>/.honcho/config.json.

Actual behavior

It returns the import-time home path instead.

Suggested investigation direction

Compute the global fallback path inside resolve_config_path() (or another runtime helper) instead of storing Path.home() in a module-level constant.

extent analysis

TL;DR

The most likely fix is to compute the global fallback path inside resolve_config_path() instead of storing Path.home() in a module-level constant.

Guidance

  • Move the computation of GLOBAL_CONFIG_PATH from import time to runtime by defining it inside resolve_config_path() or another helper function.
  • Verify the fix by running the provided minimal reproduction script and checking if the resolved path matches the expected runtime home directory.
  • Consider updating the related test in tests/honcho_plugin/test_client.py to reflect the changed behavior and ensure it no longer masks the issue.
  • Review other parts of the code that may rely on the old behavior and adjust them accordingly.

Example

def resolve_config_path():
    # Compute the global fallback path at runtime
    global_config_path = Path.home() / ".honcho" / "config.json"
    # ... rest of the function remains the same ...

Notes

This fix assumes that the desired behavior is to always resolve the config path based on the current runtime home directory. If there are other requirements or constraints, additional modifications may be necessary.

Recommendation

Apply the workaround by computing the global fallback path at runtime, as it directly addresses the identified issue and ensures the correct behavior in different environments.

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…

FAQ

Expected behavior

When HOME changes and neither $HERMES_HOME/honcho.json nor ~/.hermes/honcho.json exists, resolve_config_path() should resolve to the current runtime home, e.g. <runtime HOME>/.honcho/config.json.

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: Honcho client freezes ~/.honcho/config.json path at import time and ignores runtime HOME changes [2 pull requests]