From 38c4f8c3717518e81bc64765ab80f3192f6a113a Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Fri, 29 May 2026 12:25:37 -0700 Subject: [PATCH] test(gateway): update system-unit cwd assertion to HERMES_HOME anchor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_system_unit_has_no_root_paths asserted the system unit's WorkingDirectory was the remapped *checkout* path (/home/alice/.hermes/hermes-agent). That is the brittle pin this PR fixes — the system unit now anchors cwd at the target user's HERMES_HOME (/home/alice/.hermes). The test's intent (no root-home leak, target-user paths present) is unchanged and still holds. --- tests/hermes_cli/test_gateway_service.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/hermes_cli/test_gateway_service.py b/tests/hermes_cli/test_gateway_service.py index 4259e87d9..c6baa7156 100644 --- a/tests/hermes_cli/test_gateway_service.py +++ b/tests/hermes_cli/test_gateway_service.py @@ -1704,7 +1704,12 @@ class TestSystemUnitPathRemapping: assert str(root_home) not in unit # Target user paths should be present assert "/home/alice" in unit - assert "WorkingDirectory=/home/alice/.hermes/hermes-agent" in unit + # WorkingDirectory is anchored at the target user's HERMES_HOME (stable, + # always exists) — NOT the source checkout under it. Pinning cwd to the + # checkout is the rot bug fixed alongside this: a relocated/removed + # checkout would crash-loop the unit on CHDIR (status=200). + assert "WorkingDirectory=/home/alice/.hermes" in unit + assert "WorkingDirectory=/home/alice/.hermes/hermes-agent" not in unit class TestDockerAwareGateway: