fix(cli): suppress PseudoConsoleWindow flash from gh subprocess calls on Windows - #53962
Conversation
… on Windows Add CREATE_NO_WINDOW creationflag via windows_hide_flags() to subprocess.run calls in copilot_auth._try_gh_cli_token() and doctor._gh_authenticated(). Without this flag, gh.exe spawns a visible PseudoConsoleWindow on every invocation, causing intermittent console window flicker on Windows desktop. Fixes NousResearch#53957
Duplicate of #53961 — both PRs fix #53957 by adding the hidden-window creation flag to the same two |
|
Closing in favor of #53961 by @itsflownium — same fix (adding |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Small Windows-specific fix: adds creationflags=windows_hide_flags() to the gh subprocess call in copilot_auth.py. Uses the existing _subprocess_compat helper. Test verifies the flag is passed through. Clean and well-scoped.
Reviewed by Hermes Agent
What does this PR do?
Suppresses visible
PseudoConsoleWindowconsole window flashes on Windows by addingCREATE_NO_WINDOWcreation flags tosubprocess.runcalls that invoke theghCLI. Without this flag, everygh auth tokenandgh auth statusinvocation spawns a brief console window that flashes on screen.Related Issue
Fixes #53957
Type of Change
Changes Made
hermes_cli/copilot_auth.py: Addedcreationflags=windows_hide_flags()to thesubprocess.runcall in_try_gh_cli_token()sogh auth tokenruns without a visible console window on Windows.hermes_cli/doctor.py: Addedcreationflags=windows_hide_flags()to thesubprocess.runcall in_gh_authenticated()sogh auth statusruns without a visible console window on Windows.tests/hermes_cli/test_copilot_auth.py: AddedTestGhCliCreationFlagsregression test verifyingcreationflagsis passed tosubprocess.run.How to Test
pytest tests/hermes_cli/test_copilot_auth.py::TestGhCliCreationFlags -v— should passpytest tests/hermes_cli/test_copilot_auth.py -v— all 26 tests should passprovider: autoand verify noPseudoConsoleWindowflashes appear in the taskbar over a 45-second observation periodChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/Awindows_hide_flags()helper which returns 0 on non-Windows