Skip to content

fix(cli): suppress PseudoConsoleWindow flash from gh subprocess calls on Windows - #53962

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-53957-subprocess-no-window
Closed

fix(cli): suppress PseudoConsoleWindow flash from gh subprocess calls on Windows#53962
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:liuhao/cron-bugfix-53957-subprocess-no-window

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Suppresses visible PseudoConsoleWindow console window flashes on Windows by adding CREATE_NO_WINDOW creation flags to subprocess.run calls that invoke the gh CLI. Without this flag, every gh auth token and gh auth status invocation spawns a brief console window that flashes on screen.

Related Issue

Fixes #53957

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/copilot_auth.py: Added creationflags=windows_hide_flags() to the subprocess.run call in _try_gh_cli_token() so gh auth token runs without a visible console window on Windows.
  • hermes_cli/doctor.py: Added creationflags=windows_hide_flags() to the subprocess.run call in _gh_authenticated() so gh auth status runs without a visible console window on Windows.
  • tests/hermes_cli/test_copilot_auth.py: Added TestGhCliCreationFlags regression test verifying creationflags is passed to subprocess.run.

How to Test

  1. Run pytest tests/hermes_cli/test_copilot_auth.py::TestGhCliCreationFlags -v — should pass
  2. Run pytest tests/hermes_cli/test_copilot_auth.py -v — all 26 tests should pass
  3. On Windows: launch Hermes Desktop with auxiliary providers set to provider: auto and verify no PseudoConsoleWindow flashes appear in the taskbar over a 45-second observation period

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.2

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — uses existing windows_hide_flags() helper which returns 0 on non-Windows
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

… 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
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard area/auth Authentication, OAuth, credential pools platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows provider/copilot GitHub Copilot (ACP + Chat) P2 Medium — degraded but workaround exists duplicate This issue or pull request already exists labels Jun 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #53961 — both PRs fix #53957 by adding the hidden-window creation flag to the same two gh spawn sites (hermes_cli/copilot_auth.py _try_gh_cli_token and hermes_cli/doctor.py _gh_authenticated). #53961 was opened ~9s earlier, so it's the canonical of the pair. Maintainer picks one; this one adds a test_doctor.py case the other lacks.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

Closing in favor of #53961 by @itsflownium — same fix (adding CREATE_NO_WINDOW to gh subprocess calls in copilot_auth.py and doctor.py), created 9 seconds earlier, and includes doctor-side regression tests that this PR lacks. Both address #53957.

@liuhao1024 liuhao1024 closed this Jun 28, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/auth Authentication, OAuth, credential pools comp/cli CLI entry point, hermes_cli/, setup wizard duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists platform/windows Native Windows-specific behavior or breakage provider/copilot GitHub Copilot (ACP + Chat) sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: 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 subprocess creates visible console window on Windows (PseudoConsoleWindow flicker)

3 participants