diff --git a/plugins/platforms/photon/adapter.py b/plugins/platforms/photon/adapter.py index 27df34ecf..4dfe7ffc6 100644 --- a/plugins/platforms/photon/adapter.py +++ b/plugins/platforms/photon/adapter.py @@ -944,6 +944,10 @@ class PhotonAdapter(BasePlatformAdapter): # never runs — can't leave it orphaned on the port. env["PHOTON_SIDECAR_WATCH_STDIN"] = "1" + # Windows: hide the child console (0 elsewhere). Same helper the + # discord/whatsapp adapters use for their sidecar spawns. + from hermes_cli._subprocess_compat import windows_hide_flags + try: patch = subprocess.run( # noqa: S603 [ @@ -955,6 +959,9 @@ class PhotonAdapter(BasePlatformAdapter): text=True, timeout=10, check=False, + # Windows: suppress the brief console flash this short-lived + # node patch run would otherwise pop on every sidecar start. + creationflags=windows_hide_flags(), ) if patch.returncode != 0: raise RuntimeError((patch.stderr or patch.stdout or "").strip()) @@ -973,6 +980,10 @@ class PhotonAdapter(BasePlatformAdapter): stderr=subprocess.STDOUT, env=env, start_new_session=(sys.platform != "win32"), + # Windows: run the persistent sidecar headless so it does not open + # (or leave) a visible console window. CREATE_NO_WINDOW only (no + # DETACHED_PROCESS) so the stdin/stdout pipes above stay usable. + creationflags=windows_hide_flags(), ) # Pump sidecar stderr/stdout into our logger so users see crashes.