From f007ef8ab521e91576672e3fd2fc303193bb545f Mon Sep 17 00:00:00 2001 From: nekwo Date: Sat, 16 May 2026 13:38:38 -0400 Subject: [PATCH] fix(windows): hide cron script subprocess consoles Apply CREATE_NO_WINDOW flags when the cron scheduler launches job scripts on Windows so gateway-managed no-agent cron jobs do not flash cmd or python console windows every tick. --- cron/scheduler.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cron/scheduler.py b/cron/scheduler.py index 6302227e8f6..e76f67064cf 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -37,6 +37,7 @@ from typing import List, Optional sys.path.insert(0, str(Path(__file__).parent.parent)) from hermes_constants import get_hermes_home +from hermes_cli._subprocess_compat import windows_hide_flags from hermes_cli.config import load_config, _expand_env_vars from hermes_time import now as _hermes_now @@ -887,6 +888,7 @@ def _run_job_script(script_path: str) -> tuple[bool, str]: pass try: + popen_kwargs = {"creationflags": windows_hide_flags()} if sys.platform == "win32" else {} result = subprocess.run( argv, capture_output=True, @@ -894,6 +896,7 @@ def _run_job_script(script_path: str) -> tuple[bool, str]: timeout=script_timeout, cwd=str(path.parent), env=run_env, + **popen_kwargs, ) stdout = (result.stdout or "").strip() stderr = (result.stderr or "").strip()