fix(cli): suppress gh auth token console flash on Windows - #53390
fix(cli): suppress gh auth token console flash on Windows#53390konsisumer wants to merge 1 commit into
Conversation
Related to #53123 (also patches the |
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Comment (competing fix)
This PR and #53397 are duplicate fixes for the same issue (suppress console flash in copilot_auth gh token lookup). Both add the identical change: import windows_hide_flags and pass it as creationflags. The changes are functionally identical.
Recommendation: Close one in favor of the other. Both are small, clean fixes. The author should coordinate to avoid merge conflicts.
Looks Good
- Clean, focused fix
- Uses the correct windows_hide_flags() utility
- Includes test coverage
- No security concerns
Reviewed by Hermes Agent
|
Closing as superseded by the consolidated Windows console-flash work tracked in #54220. The relevant pieces from this PR/cluster have now landed through the targeted follow-up PRs #54236, #53892, and #54417, or are recorded in the umbrella tracker for any remaining native-Windows verification. Keeping this separate PR open would duplicate the tracker and the merged follow-up work. Thanks for digging into this — the reports and PRs in this cluster helped identify the remaining spawn legs. |
What does this PR do?
This fixes the Windows console-window flash caused by the
gh auth tokenfallback inhermes_cli/copilot_auth.py. The Copilot credential lookup now uses the sharedwindows_hide_flags()helper so Hermes can poll GitHub CLI credentials without spawning a visible console window on native Windows.Related Issue
Fixes #53370
Type of Change
Changes Made
hermes_cli/copilot_auth.py: passcreationflags=windows_hide_flags()to the synchronousgh auth tokensubprocess so Windows hides the transient console window while preserving captured stdout.tests/hermes_cli/test_copilot_auth.py: add a regression test asserting_try_gh_cli_token()forwards the Windows hide flags intosubprocess.run().How to Test
gh auth tokenreturns a valid token, then trigger a Copilot credential lookup path that falls back to_try_gh_cli_token()and confirm no console window flashes.pytest tests/hermes_cli/test_copilot_auth.py tests/hermes_cli/test_api_key_providers.py -q.python scripts/check-windows-footguns.py --diff HEADandgit diff --check.What platforms tested on
Checklist
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/AScreenshots / Logs
pytest tests/hermes_cli/test_copilot_auth.py tests/hermes_cli/test_api_key_providers.py -q→191 passed.python scripts/check-windows-footguns.py --diff HEAD→ no Windows footguns found.ruff check hermes_cli/copilot_auth.py tests/hermes_cli/test_copilot_auth.py→ clean.fastapi/uvicorn; broader importer subsets also exposed unrelated pre-existing failures intests/run_agent/test_run_agent_codex_responses.py,tests/hermes_cli/test_auth_commands.py, andtests/agent/test_credential_pool.py.