Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/cli/test_cli_yolo_toggle.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@
def _clear_approval_state(monkeypatch):
"""Clear the YOLO bypass + env var around every test so cases are independent."""
monkeypatch.delenv("HERMES_YOLO_MODE", raising=False)
# The value is intentionally frozen at tools.approval import time. Local
# Hermes-driven test runs may inherit HERMES_YOLO_MODE=1 from the parent
# agent process, so make the default test state hermetic; the one test that
# covers startup-frozen YOLO explicitly patches it back to True.
monkeypatch.setattr(approval_module, "_YOLO_MODE_FROZEN", False)
approval_module.clear_session(SESSION_KEY)
approval_module.clear_session("default")
yield
Expand Down
16 changes: 16 additions & 0 deletions tests/hermes_cli/test_signal_handler_kanban_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@ def _is_alive_like_dispatcher(pid: int) -> bool:
break
except (FileNotFoundError, PermissionError, OSError):
pass
elif sys.platform == "darwin":
try:
proc = subprocess.run(
["ps", "-o", "stat=", "-p", str(pid)],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
text=True,
timeout=1,
check=False,
)
if proc.returncode != 0:
return False
if "Z" in (proc.stdout or "").strip():
return False
except (OSError, subprocess.SubprocessError, TimeoutError):
pass
return True


Expand Down