fix: make profile subprocess HOME policy explicit

This commit is contained in:
Teknium 2026-06-14 02:48:52 -07:00
parent b00060ce54
commit 723c2331bd
16 changed files with 342 additions and 253 deletions

View file

@ -1270,14 +1270,8 @@ def execute_code(
child_env["TZ"] = _tz_name
child_env.pop("HERMES_TIMEZONE", None)
# Per-profile HOME isolation: redirect system tool configs into
# {HERMES_HOME}/home/ when that directory exists.
from hermes_constants import get_subprocess_home
_profile_home = get_subprocess_home()
if _profile_home:
child_env["HOME"] = _profile_home
from hermes_constants import get_real_home
child_env["HERMES_REAL_HOME"] = get_real_home()
from hermes_constants import apply_subprocess_home_env
apply_subprocess_home_env(child_env)
# Resolve interpreter + CWD based on execute_code mode.
# - strict : today's behavior (sys.executable + tmpdir CWD).