diff --git a/hermes_cli/kanban_db.py b/hermes_cli/kanban_db.py index 9930a6aa51a..633b952ab45 100644 --- a/hermes_cli/kanban_db.py +++ b/hermes_cli/kanban_db.py @@ -4383,21 +4383,20 @@ def reap_worker_zombies() -> "list[int]": Returns the list of reaped PIDs. Safe to call when there are no children (returns []). No-op on Windows. """ - if os.name == "nt": - return [] reaped: "list[int]" = [] - try: - while True: - try: - pid, status = os.waitpid(-1, os.WNOHANG) - except ChildProcessError: - break - if pid == 0: - break - _record_worker_exit(pid, status) - reaped.append(pid) - except Exception: - pass + if os.name != "nt": + try: + while True: + try: + pid, status = os.waitpid(-1, os.WNOHANG) + except ChildProcessError: + break + if pid == 0: + break + _record_worker_exit(pid, status) + reaped.append(pid) + except Exception: + pass return reaped diff --git a/tests/cli/test_cli_provider_resolution.py b/tests/cli/test_cli_provider_resolution.py index e71226da53f..a25d903f687 100644 --- a/tests/cli/test_cli_provider_resolution.py +++ b/tests/cli/test_cli_provider_resolution.py @@ -271,7 +271,10 @@ def test_codex_provider_replaces_incompatible_default_model(monkeypatch): def test_model_flow_nous_prints_subscription_guidance_without_mutating_explicit_tts(monkeypatch, capsys): - monkeypatch.setattr("hermes_cli.nous_subscription.managed_nous_tools_enabled", lambda: True) + monkeypatch.setattr( + "hermes_cli.nous_subscription.managed_nous_tools_enabled", + lambda *args, **kwargs: True, + ) config = { "model": {"provider": "nous", "default": "claude-opus-4-6"}, "tts": {"provider": "elevenlabs"}, @@ -306,7 +309,10 @@ def test_model_flow_nous_prints_subscription_guidance_without_mutating_explicit_ def test_model_flow_nous_offers_tool_gateway_prompt_when_unconfigured(monkeypatch, capsys): - monkeypatch.setattr("hermes_cli.nous_subscription.managed_nous_tools_enabled", lambda: True) + monkeypatch.setattr( + "hermes_cli.nous_subscription.managed_nous_tools_enabled", + lambda *args, **kwargs: True, + ) config = { "model": {"provider": "nous", "default": "claude-opus-4-6"}, "tts": {"provider": "edge"}, diff --git a/tests/tools/test_kanban_tools.py b/tests/tools/test_kanban_tools.py index 3fc709d38de..24fa09d8ba2 100644 --- a/tests/tools/test_kanban_tools.py +++ b/tests/tools/test_kanban_tools.py @@ -1338,6 +1338,7 @@ def test_worker_complete_rejects_stale_run_id(worker_env, monkeypatch): try: run1 = kb.latest_run(conn, worker_env) kb._set_worker_pid(conn, worker_env, 98765) + monkeypatch.setenv("HERMES_KANBAN_CRASH_GRACE_SECONDS", "0") monkeypatch.setattr(_kb, "_pid_alive", lambda pid: False) assert kb.detect_crashed_workers(conn) == [worker_env] diff --git a/tests/tools/test_terminal_requirements.py b/tests/tools/test_terminal_requirements.py index a557dcd9f20..f06593015ce 100644 --- a/tests/tools/test_terminal_requirements.py +++ b/tests/tools/test_terminal_requirements.py @@ -165,7 +165,7 @@ def test_modal_backend_managed_mode_does_not_fall_back_to_direct(monkeypatch, ca assert ok is False assert any( - "paid Nous subscription is required" in record.getMessage() + "Nous Tool Gateway access is not currently available" in record.getMessage() for record in caplog.records ) @@ -183,6 +183,6 @@ def test_modal_backend_managed_mode_without_feature_flag_logs_clear_error(monkey assert ok is False assert any( - "paid Nous subscription is required" in record.getMessage() + "Nous Tool Gateway access is not currently available" in record.getMessage() for record in caplog.records )