fix(core): isolate HOME per profile to persist system credentials and…#4437
fix(core): isolate HOME per profile to persist system credentials and…#4437devorun wants to merge 1 commit into
Conversation
|
Thanks for the quick fix! Worth noting that setting $HOME won't cover tools that resolve the home directory via getpwuid(getuid()) at runtime. Those will still see /root regardless of $HOME. Might be worth documenting this limitation or considering a more complete solution long-term. |
|
Another edge case: Playwright installs browser binaries to $HOME/.cache/ms-playwright/ at build time, which resolves to /root/.cache/ during docker build. After this fix, HOME moves to the profile directory at runtime and Playwright won't find its binaries, even with a single profile. |
|
Thanks @ferranbonas Your proposed fix for Playwright makes sense. I'll add the I'll also include a quick note in the docs about the |
|
Thanks for the PR and the thorough issue writeup in #4426 — the problems you identified (credential sharing across profiles, Docker non-persistence) are real. Unfortunately, mutating
This is by design — profile operations need the real user HOME so that The right approach for credential isolation would be tool-specific env vars ( Appreciate the contribution! |
|
Thanks for taking the time to review and explain the internals! I suspected there might be deeper Python-level issues I wasn't seeing. Appreciate the thorough response. |
… fix Docker setup (#4426)
What does this PR do?
Fixes #4426
The Issue:
Previously, Hermes correctly set
HERMES_HOMEfor each profile but left the system'sHOMEenvironment variable untouched (defaulting to/rootin Docker). This caused two critical bugs:/root/directory, causing credentials to leak across different agent profiles./root/is not part of the persistent/opt/datavolume.The Fix:
Modified
resolve_profile_envto automatically inject a per-profileHOMEdirectory (<profile_dir>/home) intoos.environ.This ensures that all subprocesses and system tools write their configurations (like
.gitconfigand.ssh/) directly into the profile's isolated and persistent storage, fixing both the isolation leak and the Docker persistence issue simultaneously.Related Issue
Fixes #
Type of Change
Changes Made
How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs