Skip to content

HarnessRouter Community Edition: the self-hosted, Apache-2.0 edition of the unified interface for agent harnesses. Run Codex, Claude Code, Hermes, PI, DSH, and more through one API, with sessions, streaming, files, cancellation, and failure handling. Implements the Unified Harness Protocol (UHP), an open standard. Your keys, your infrastructure.

test(runner): the workspace-delete test owns its root instead of trusting import order

richard-epsillaf6bf68461f33
diff --git a/runner/tests/test_workspace_delete.py b/runner/tests/test_workspace_delete.py
index 13f2c748..20c99dad 100644
--- a/runner/tests/test_workspace_delete.py
+++ b/runner/tests/test_workspace_delete.py
@@ -9,14 +9,17 @@ import pathlib
import sys
import tempfile
-_ROOT = tempfile.mkdtemp(prefix="hr-runner-ws-")
-os.environ["HARNESS_WORKSPACE"] = _ROOT
sys.path.insert(0, str(pathlib.Path(__file__).resolve().parents[1]))
import server as S # noqa: E402
from fastapi import HTTPException # noqa: E402
-def test_the_folder_goes_and_the_root_and_a_missing_folder_are_safe():
+def test_the_folder_goes_and_the_root_and_a_missing_folder_are_safe(monkeypatch):
+ # The module reads its root at import, and another test module may have imported it first:
+ # point the root at a fresh directory for this test rather than depend on import order.
+ _ROOT = tempfile.mkdtemp(prefix="hr-runner-ws-")
+ monkeypatch.setattr(S, "WORKSPACE_ROOT", _ROOT)
+ monkeypatch.setattr(S, "_SANDBOX_PER_SESSION", False)
sid = "hsess0123456789abcdef0123456789abcdef"
ws = S._ws(sid)
os.makedirs(os.path.join(ws, "sub"), exist_ok=True)