fix(windows): stop GUI update from stacking visible terminals#167
fix(windows): stop GUI update from stacking visible terminals#167Wibias wants to merge 7 commits into
Conversation
…le flashes Pin post-update proxy restart to config.port, wait briefly for the listen socket to free, and avoid spawning visible PowerShell/icacls windows on the start hot path.
Port stickiness stays scoped to restart/port behavior; icacls ACL soft-fail lives elsewhere.
Hide the Task Scheduler wrapper via a WScript launcher (window style 0), pipe npm/update child stdio under OCX_SERVICE=1, and keep post-update restart pinned to config.port so failed starts do not fuel the :loop.
Keep main's absorbed port-stickiness + pid identity checks; retain hidden WScript service launcher and quiet GUI-worker npm stdio.
WaitOnReturn=True so wscript stays alive for the batch lifetime; False made CI see Ready despite a healthy proxy.
…child stdio (port #167) - ocx update --help printed nothing useful and ran the REAL self-update, stopping the proxy mid-stream. Both entry paths (Bun CLI and the npm bin launcher, which intercepts update before Bun starts) now print usage and exit 0. Verified live: both print usage, exit 0, no update side effects. - Port the still-unique part of PR #167: under the GUI update worker (OCX_SERVICE=1, stdio ignored) the stop/installer/service-reinstall children now use pipe stdio with bounded output relay, so npm.cmd (shell:true) cannot open stacked visible consoles on Windows. Backend- preserving serviceReinstallArgs() is kept; the rest of #167 is already superseded by the dev Windows-service lane.
|
Thanks for tracking down the console-storm root cause — the diagnosis in this PR (visible Task Scheduler console + wrapper retry loop) matches what we found independently, and it helped confirm the direction. Since this PR opened, the
One part of this PR was still unique and valuable: piping child stdio under the GUI update worker ( So: closed as superseded, with the stdio fix landed. Thanks again! |
Summary
opencodex-service.cmdas a visible console, and the wrapper:loopretriedocx startevery ~5s when start failed mid-update (often port-busy).Run …, 0, False) and point the task atwscript.exe.ocx start --port+ prefer-retry / wait-for-free) from closed fix: keep configured port after update restart #152 so restarts do not hop ports and fuel the loop.OCX_SERVICE=1), use pipe stdio for npm/stop/service children sonpm.cmddoes not open stacked cmd windows.Test plan
bun test tests/service.test.ts tests/update-job.test.ts tests/update-stop-first.test.ts tests/ports.test.tsocx service installis in use: reinstall/update rewrites the hidden VBS+XML; only one wrapper runs