chore: anchor fresh-start history to upstream

This commit is contained in:
2026-09-16 15:06:54 +08:00
parent 64a9b43261
commit 012c9c6bed
3514 changed files with 48322 additions and 187346 deletions
+1 -9
View File
@@ -112,7 +112,7 @@ def _scrub_child_env(source_env, is_passthrough=None, is_windows=None):
def _build_child_env(*, rpc_endpoint: str, rpc_token: str, tmpdir: str,
child_python: str) -> Dict[str, str]:
"""Build the scrubbed child environment both execution paths share."""
from hermes_constants import apply_subprocess_home_env, get_hermes_home_override
from hermes_constants import apply_subprocess_home_env
child_env = _scrub_child_env(os.environ)
child_env["HERMES_RPC_SOCKET"] = rpc_endpoint
child_env["HERMES_RPC_TOKEN"] = rpc_token
@@ -130,14 +130,6 @@ def _build_child_env(*, rpc_endpoint: str, rpc_token: str, tmpdir: str,
child_env["TZ"] = _tz_name
child_env.pop("HERMES_TIMEZONE", None)
apply_subprocess_home_env(child_env)
# Multiplexed gateway/Desktop (#110303): the server process env carries the machine-default
# HERMES_HOME, but this turn runs under a per-profile override (ContextVar bound per turn).
# The scrub above passed the stale default through; rewrite it so skill scripts see the
# active profile's home — the same per-turn rewrite apply_subprocess_home_env does for HOME.
# No override (dedicated per-profile process) → leave the inherited value untouched.
_home_override = get_hermes_home_override()
if _home_override:
child_env["HERMES_HOME"] = _home_override
# PYTHONPATH: the staging dir (hermes_tools.py) must always be importable even when project
# mode changes CWD. Hermes's root is added ONLY when the child runs in Hermes's Python env —
# exposing Hermes's site-packages to an external interpreter can mix incompatible compiled