The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
test: repoint WSL/container probe patches to hermes_platform.host.runtime (group B)
alt-glitch0bdf33b7d9f0
diff --git a/tests/acp_adapter/test_session.py b/tests/acp_adapter/test_session.pyindex d7a95ecef95..d692569e89c 100644--- a/tests/acp_adapter/test_session.py+++ b/tests/acp_adapter/test_session.py@@ -46,7 +46,7 @@ class TestCreateSession:captured["task_id"] = task_idcaptured["overrides"] = overrides- monkeypatch.setattr("hermes_constants._wsl_detected", True)+ monkeypatch.setattr("hermes_platform.host.runtime._wsl_detected", True)monkeypatch.setattr("tools.terminal_tool.register_task_env_overrides",fake_register_task_env_overrides,@@ -204,7 +204,7 @@ class TestCreateSession:class TestWslCwdTranslation:def test_translate_acp_cwd_converts_windows_drive_path_when_wsl(self, monkeypatch):- monkeypatch.setattr("hermes_constants._wsl_detected", True)+ monkeypatch.setattr("hermes_platform.host.runtime._wsl_detected", True)assert acp_session._translate_acp_cwd(r"E:\Projects\AI\paperclip") == "/mnt/e/Projects/AI/paperclip"@@ -213,7 +213,7 @@ class TestWslCwdTranslation:def test_fork_session_stores_translated_cwd_on_wsl(self, manager, monkeypatch):- monkeypatch.setattr("hermes_constants._wsl_detected", True)+ monkeypatch.setattr("hermes_platform.host.runtime._wsl_detected", True)original = manager.create_session(cwd="/tmp/base")forked = manager.fork_session(original.session_id, cwd=r"D:\work\project")@@ -222,7 +222,7 @@ class TestWslCwdTranslation:assert forked.cwd == "/mnt/d/work/project"def test_update_cwd_stores_translated_cwd_on_wsl(self, manager, monkeypatch):- monkeypatch.setattr("hermes_constants._wsl_detected", True)+ monkeypatch.setattr("hermes_platform.host.runtime._wsl_detected", True)state = manager.create_session(cwd="/tmp/old")updated = manager.update_cwd(state.session_id, cwd=r"C:\Users\foo\project")diff --git a/tests/tools/test_clipboard.py b/tests/tools/test_clipboard.pyindex 0f503400377..ad99c915aab 100644--- a/tests/tools/test_clipboard.py+++ b/tests/tools/test_clipboard.py@@ -17,6 +17,7 @@ from unittest.mock import patch, MagicMock, mock_openimport pytest+from hermes_platform.host import runtime as host_runtimefrom hermes_cli.clipboard import (save_clipboard_image,has_clipboard_image,@@ -173,18 +174,14 @@ class TestMacosClipboardFileUrl:class TestIsWsl:def setup_method(self):- # _is_wsl is hermes_constants.is_wsl; reset the function's own module- # globals so this stays stable even if hermes_constants was imported- # through a different module object earlier in a large xdist run.- import hermes_constants- hermes_constants._wsl_detected = None+ # Reset the cache in the module that owns _is_wsl.+ host_runtime._wsl_detected = None_is_wsl.__globals__["_wsl_detected"] = Nonedef teardown_method(self):# Reset again after the test so we don't leak a cached value# (True/False) into whichever test the xdist worker runs next.- import hermes_constants- hermes_constants._wsl_detected = None+ host_runtime._wsl_detected = None_is_wsl.__globals__["_wsl_detected"] = None@pytest.mark.parametrize("content, expected", [@@ -343,8 +340,7 @@ class TestLinuxSave:"""Test that _linux_save dispatches correctly to WSL → Wayland → X11."""def setup_method(self):- import hermes_cli.clipboard as cb- cb._wsl_detected = None+ host_runtime._wsl_detected = Nonedef test_wsl_tried_first(self, tmp_path):dest = tmp_path / "out.png"@@ -458,8 +454,7 @@ class TestConvertToPng:class TestHasClipboardImage:def setup_method(self):- import hermes_cli.clipboard as cb- cb._wsl_detected = None+ host_runtime._wsl_detected = None@pytest.mark.macos_onlydef test_macos_dispatch(self):