fix(photon): hide the npm dep self-heal console flashes on Windows too

Widen @lEWFkRAD's sidecar-headless fix (PR #54565) to the sibling spawn
sites: the npm ci / npm install self-heal runs in _reinstall_sidecar_deps
also popped a brief console window per run on Windows. Same
windows_hide_flags() helper (CREATE_NO_WINDOW only, so capture_output
stays usable).
This commit is contained in:
Teknium 2026-07-16 00:26:37 -07:00
parent d68ac9092a
commit f8bf40b18b

View file

@ -174,6 +174,10 @@ def _reinstall_sidecar_deps() -> None:
if not npm:
logger.warning("[photon] cannot reinstall stale sidecar deps: npm not on PATH")
return
# Windows: suppress the console flash these short-lived npm runs would
# otherwise pop (0 elsewhere). Same helper as the sidecar spawn below.
from hermes_cli._subprocess_compat import windows_hide_flags
try:
result = subprocess.run( # noqa: S603
[npm, "ci"],
@ -182,6 +186,7 @@ def _reinstall_sidecar_deps() -> None:
text=True,
check=False,
timeout=_NPM_REINSTALL_TIMEOUT,
creationflags=windows_hide_flags(),
)
if result.returncode != 0:
logger.warning(
@ -194,6 +199,7 @@ def _reinstall_sidecar_deps() -> None:
text=True,
check=False,
timeout=_NPM_REINSTALL_TIMEOUT,
creationflags=windows_hide_flags(),
)
except subprocess.TimeoutExpired:
# A wedged npm (dead registry, network blackhole) must not stall the