Skip to content

Bug: Honcho client freezes ~/.honcho/config.json path at import time and ignores runtime HOME changes #13283

@NewTurn2017

Description

@NewTurn2017

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havecomp/pluginsPlugin system and bundled pluginstype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions