hermes-agent/tools/environments
Teknium 4fb42d0193
fix: per-profile subprocess HOME isolation (#4426) (#7357)
Isolate system tool configs (git, ssh, gh, npm) per profile by injecting
a per-profile HOME into subprocess environments only.  The Python
process's own os.environ['HOME'] and Path.home() are never modified,
preserving all existing profile infrastructure.

Activation is directory-based: when {HERMES_HOME}/home/ exists on disk,
subprocesses see it as HOME.  The directory is created automatically for:
- Docker: entrypoint.sh bootstraps it inside the persistent volume
- Named profiles: added to _PROFILE_DIRS in profiles.py

Injection points (all three subprocess env builders):
- tools/environments/local.py _make_run_env() — foreground terminal
- tools/environments/local.py _sanitize_subprocess_env() — background procs
- tools/code_execution_tool.py child_env — execute_code sandbox

Single source of truth: hermes_constants.get_subprocess_home()

Closes #4426
2026-04-10 13:37:45 -07:00
..
__init__.py feat(environments): add Daytona cloud sandbox backend 2026-03-05 10:02:21 -08:00
base.py fix: remove 115 verified dead code symbols across 46 production files 2026-04-10 03:44:43 -07:00
daytona.py fix: remove 115 verified dead code symbols across 46 production files 2026-04-10 03:44:43 -07:00
docker.py fix: remove 115 verified dead code symbols across 46 production files 2026-04-10 03:44:43 -07:00
file_sync.py feat(environments): unified file sync with change tracking and deletion 2026-04-10 03:01:46 -07:00
local.py fix: per-profile subprocess HOME isolation (#4426) (#7357) 2026-04-10 13:37:45 -07:00
managed_modal.py feat(environments): unified spawn-per-call execution layer 2026-04-08 17:23:15 -07:00
modal.py fix: remove 115 verified dead code symbols across 46 production files 2026-04-10 03:44:43 -07:00
modal_utils.py feat(environments): unified spawn-per-call execution layer 2026-04-08 17:23:15 -07:00
singularity.py feat(environments): unified spawn-per-call execution layer 2026-04-08 17:23:15 -07:00
ssh.py feat(environments): unified file sync with change tracking and deletion 2026-04-10 03:01:46 -07:00