fix: make profile subprocess HOME policy explicit

This commit is contained in:
Teknium
2026-06-14 03:20:21 -07:00
parent b00060ce54
commit 723c2331bd
16 changed files with 342 additions and 253 deletions
+2 -16
View File
@@ -70,16 +70,6 @@ def _resolve_args() -> list[str]:
def _resolve_home_dir() -> str:
"""Return a stable HOME for child ACP processes."""
try:
from hermes_constants import get_subprocess_home
profile_home = get_subprocess_home()
if profile_home:
return profile_home
except Exception:
pass
home = os.environ.get("HOME", "").strip()
if home:
return home
@@ -107,12 +97,8 @@ def _build_subprocess_env() -> dict[str, str]:
env = os.environ.copy()
home = _resolve_home_dir()
env["HOME"] = home
# Always expose the real user home so child scripts can find
# ~/.hermes/ even when HOME is overridden for profile isolation.
from hermes_constants import get_real_home
real = get_real_home()
if real and real != home:
env["HERMES_REAL_HOME"] = real
from hermes_constants import apply_subprocess_home_env
apply_subprocess_home_env(env)
return env