fix(windows): make gateway install lifecycle idempotent#26488
Conversation
8850525 to
c88d716
Compare
Preserve Windows profile install decisions across UAC handoff, avoid visible console windows by launching via pythonw, make repeated install/start idempotent, recreate stale Scheduled Tasks, and separate start-now from login auto-start behavior. Add Windows gateway regression coverage and systemd setup tests for the shared install flow.
Apply Windows CREATE_NO_WINDOW flags to foreground local terminal subprocesses and tracked background processes so Hermes operations do not flash or steal focus with extra console windows.
c88d716 to
0f8ce0b
Compare
|
had a very dirty tree just updated the rest of the code
|
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.
|
It's mostly so far the cron jobs, i just patched it more, those shell windows flash like maniacs randomly (seizure inducing) I think i caught them all but maybe your ai can do a deep audit @alt-glitch |
|
i can fix it too if you'd like in another pull request i found it's across a bunch of modules but i don't want to stomp over everything and everyone |
|
Salvaged onto current main via PR #28874 (your 3 commits cherry-picked with your authorship preserved in git log; one tiny cross-platform test fixup added on top). Original branch was 23 commits behind |
What does this PR do?
Fixes Windows gateway install/start behavior so repeated hermes gateway install, hermes gateway start, and setup flows are idempotent and do not create duplicate gateway processes or leave visible console windows behind. Interactive window y/n on starting profile gateway after profile gateway installation, incorporating UAC priveledge escalation if need be
This PR addresses several Windows-native gateway lifecycle issues:
The implementation keeps the normal Scheduled Task path as the preferred Windows login-start mechanism, uses schtasks /Create /F to replace stale task definitions without deleting the old task first, and falls back to the Startup folder only when Scheduled Task creation is unavailable or declined.
It also adds regression tests for the Windows gateway lifecycle behavior, including no duplicate start, UAC handoff, Startup fallback, direct detached spawn, and generated wrapper behavior.
Related Issue
#26487
Fixes #
Type of Change
Changes Made
hermes_cli/gateway_windows.py
hermes_cli/gateway.py
hermes_cli/main.py
tools/environments/local.py
tools/process_registry.py
tests/hermes_cli/test_gateway_windows.py
tests/hermes_cli/test_gateway.py
How to Test
Targeted tests:
Expected result:
Additional checks:
Manual Windows behavior to verify:
Checklist
Code
Documentation & Housekeeping