fix(env_passthrough): tolerate an unresolvable home when keying the allowlist cache

_make_run_env runs with a stripped environ on Windows children; hermes_home_key()
raises RuntimeError there (no HOME/USERPROFILE). Fall back to an unkeyed slot
instead of failing the sandbox env build.
This commit is contained in:
Teknium
2026-09-11 10:40:31 -07:00
parent d198082172
commit 53e32d0581
+5 -1
View File
@@ -86,7 +86,11 @@ def _load_config_passthrough() -> frozenset[str]:
credentials into sandbox children either (GHSA-rhgp-j443-p4rf)."""
from hermes_constants import hermes_home_key
home_key = hermes_home_key()
try:
home_key = hermes_home_key()
except (RuntimeError, OSError):
# No resolvable home (stripped environ in a sandbox child): nothing to scope by.
home_key = ""
cached = _config_passthrough.get(home_key)
if cached is not None:
return cached