fix: complete browser_tool profile isolation — replace remaining 3 hardcoded HERMES_HOME instances

The original PR fixed 4 of 7 instances. This fixes the remaining 3:
- _launch_local_browser() PATH setup (line 908)
- _start_recording() config read (line 1545)
- _cleanup_old_recordings() path (line 1834)
This commit is contained in:
Teknium
2026-04-03 12:32:10 -07:00
committed by Teknium
parent a09fa690f0
commit 4979d77a4a

View File

@@ -905,7 +905,7 @@ def _run_browser_command(
# Ensure PATH includes Hermes-managed Node first, Homebrew versioned
# node dirs (for macOS ``brew install node@24``), then standard system dirs.
hermes_home = Path(os.environ.get("HERMES_HOME", Path.home() / ".hermes"))
hermes_home = get_hermes_home()
hermes_node_bin = str(hermes_home / "node" / "bin")
existing_path = browser_env.get("PATH", "")
@@ -1542,7 +1542,7 @@ def _maybe_start_recording(task_id: str):
if task_id in _recording_sessions:
return
try:
hermes_home = Path(os.environ.get("HERMES_HOME", Path.home() / ".hermes"))
hermes_home = get_hermes_home()
config_path = hermes_home / "config.yaml"
record_enabled = False
if config_path.exists():
@@ -1831,7 +1831,7 @@ def _cleanup_old_recordings(max_age_hours=72):
"""Remove browser recordings older than max_age_hours to prevent disk bloat."""
import time
try:
hermes_home = Path(os.environ.get("HERMES_HOME", Path.home() / ".hermes"))
hermes_home = get_hermes_home()
recordings_dir = hermes_home / "browser_recordings"
if not recordings_dir.exists():
return