Skip to content

The agent that grows with you

fix(terminal): default the pipe marker so env fixtures built without __init__ keep working

Tekniuma615a5609649
diff --git a/tests/hermes_cli/test_agent_env_advertisement.py b/tests/hermes_cli/test_agent_env_advertisement.py
index 7251be96f8c..aaf0bd18856 100644
--- a/tests/hermes_cli/test_agent_env_advertisement.py
+++ b/tests/hermes_cli/test_agent_env_advertisement.py
@@ -53,7 +53,6 @@ class TestWrapCommandAdvertisesHarness:
env._snapshot_ready = False
env._session_id = "testsession0"
env._cwd_marker = "__HERMES_CWD_testsession0__"
- env._pipe_marker = "__HERMES_PIPE_testsession0__"
env._snapshot_path = "/tmp/hermes-snap-testsession0.sh"
env._snapshot_passthrough_names = set()
return env._wrap_command(command, "/tmp")
diff --git a/tests/tools/test_docker_environment.py b/tests/tools/test_docker_environment.py
index 0d1418f951b..1cc01ca8ac4 100644
--- a/tests/tools/test_docker_environment.py
+++ b/tests/tools/test_docker_environment.py
@@ -115,7 +115,6 @@ def _make_execute_only_env(forward_env=None):
env._snapshot_path = "/tmp/hermes-snap-test123.sh"
env._cwd_file = "/tmp/hermes-cwd-test123.txt"
env._cwd_marker = "__HERMES_CWD_test123__"
- env._pipe_marker = "__HERMES_PIPE_test123__"
env._snapshot_ready = True
env._last_sync_time = None
env._init_env_args = []
diff --git a/tools/environments/base.py b/tools/environments/base.py
index 46700ca5ff6..bcb2ba0ae8d 100644
--- a/tools/environments/base.py
+++ b/tools/environments/base.py
@@ -297,6 +297,9 @@ class BaseEnvironment(ABC):
# through the active profile scope; other backends keep plain snapshots.
_profile_scoped_passthrough: bool = False
+ # Per-session PIPESTATUS marker set in __init__; empty means the wrapper emits none.
+ _pipe_marker: str = ""
+
def get_temp_dir(self) -> str:
"""Return the backend temp directory used for session artifacts.
@@ -630,7 +633,7 @@ class BaseEnvironment(ABC):
only when THIS command emitted a marker: a killed/timed-out command emits none and
``self.cwd`` keeps the previous value. The environment is shared across sessions, so
concurrent callers must read ``result["cwd"]`` rather than ``self.cwd``."""
- pipe_split = _split_cwd_marker(result.get("output", ""), self._pipe_marker)
+ pipe_split = _split_cwd_marker(result.get("output", ""), self._pipe_marker) if self._pipe_marker else None
if pipe_split is not None:
statuses, cleaned = pipe_split
result["output"] = cleaned