From db7f4cab9c60ff5db009cf3fc625e9a86a465ef6 Mon Sep 17 00:00:00 2001 From: Godopu Date: Tue, 13 Oct 2026 10:01:55 +0900 Subject: [PATCH] test(sandbox): mam_sandbox also drops HERDR_SESSION (reviews 63919c5d / 191f0ec3, non-blocking) The caller-server helpers read it, so tests branched on whether they ran in an agent pane. L2 covers it. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff --- tests/conftest.py | 3 +++ tests/test_herdr_real_server_leak.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index 037c5bf..0f058a5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -293,7 +293,10 @@ def mam_sandbox(tmp_path, monkeypatch, request): # A herdr pane exports its server's socket (and pane/tab ids). The real # herdr follows HERDR_SOCKET_PATH over the sandbox HOME, so a call that # missed the mock reached the caller's real server and opened panes there. + # HERDR_SESSION resolves under the sandbox HOME, but the caller-server + # helpers read it, so tests branched on whether they ran in a pane. monkeypatch.delenv("HERDR_SOCKET_PATH", raising=False) + monkeypatch.delenv("HERDR_SESSION", raising=False) monkeypatch.delenv("HERDR_PANE_ID", raising=False) monkeypatch.delenv("HERDR_TAB_ID", raising=False) # Issue #45: the shim bootstrap writes a herdr server config next to the diff --git a/tests/test_herdr_real_server_leak.py b/tests/test_herdr_real_server_leak.py index ecf71bb..28dc107 100644 --- a/tests/test_herdr_real_server_leak.py +++ b/tests/test_herdr_real_server_leak.py @@ -72,7 +72,8 @@ def test_l1_a_directory_named_shim_is_still_skipped(mam_sandbox, mock_herdr): PANE_VARS = {"HERDR_SOCKET_PATH": "/nonexistent/sessions/real/herdr.sock", "HERDR_PANE_ID": "w9:p1", "HERDR_TAB_ID": "w9:t1", - "HERDR_WORKSPACE_ID": "w9", "HERDR_SESSION_NAME": "real"} + "HERDR_WORKSPACE_ID": "w9", "HERDR_SESSION_NAME": "real", + "HERDR_SESSION": "real"} @pytest.fixture