fix(tests): tests no longer reach a real herdr server - a *-shim ancestor hid the mock, the sandbox kept the pane's socket

A suite run from an agent pane with --basetemp .../pytest-pr56-shim left
seven workspaces on that pane's real server (multi-agent-mux):
- the real-herdr resolvers (lib.sh _is_shim_path and the generated shim)
  skipped every PATH directory with "-shim" anywhere in its path, so the
  basetemp hid the mock's bin/ and the real herdr ran; only a directory
  that is itself *-shim is a wrapper now;
- mam_sandbox kept HERDR_SOCKET_PATH (and the pane/tab ids), which the real
  herdr follows over the sandbox HOME; it drops them now.

tests/test_herdr_real_server_leak.py: L1 (ancestor *-shim, both resolvers)
and L2 (pane routing dropped) fail before the fix; L1b keeps a *-shim
wrapper directory excluded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-10-13 09:15:22 +09:00
1 parent 8b0b4a07dc
commit 525df2bb58
3 files changed
+102 -3

No files matched your search

+6
View File
@@ -290,6 +290,12 @@ def mam_sandbox(tmp_path, monkeypatch, request):
monkeypatch.delenv("HERDR_SESSION_NAME", raising=False)
monkeypatch.delenv("HERDR_SERVER_NAME", raising=False)
monkeypatch.delenv("HERDR_WORKSPACE_ID", raising=False)
# 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.
monkeypatch.delenv("HERDR_SOCKET_PATH", 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
# user's; with these unset that is $HOME/.config/herdr, inside the sandbox.
# Every pane of a MAM server inherits HERDR_CONFIG_PATH.