fix(ssh): hide Windows console subprocesses - #46134
Conversation
|
Verification: Reviewed the diff — clean Windows-specific security improvement for SSH subprocess visibility. Checked:
|
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Clean Windows UX fix. On Windows, SSH/SCP subprocesses now use creationflags=0x08000000 (CREATE_NO_WINDOW) to avoid flashing console windows during remote operations.
Looks Good
_hidden_console_kwargs()helper cleanly abstracts the platform-specific logic.- Applied consistently across all subprocess.Popen and subprocess.run calls in the SSH environment.
- Good test coverage added for both the flag-available and flag-not-needed code paths.
Reviewed by Hermes Agent
|
Closing after the class-level fix in PR #70205 (commit 0dbf639): Windows console flashes were caused by Hermes daemons running console-less (pythonw / DETACHED_PROCESS parents), forcing every console-subsystem child to allocate its own visible window. Main now launches every daemon (gateway, Scheduled Task, UAC handoff, dashboard, desktop backend) with a hidden console that all descendants inherit — so the spawn sites this PR flags no longer have a reachable flash under any shipped launch path (interactive terminals never flashed; children inherit the visible console there). The sites you patched were genuinely unflagged, and the diagnosis was sound against the old launch topology — the ground just moved under it. Rather than keep growing per-site flags across an unbounded set of leaf spawns, we're standardizing on the parent-console fix. If a flash reappears on current main under a shipped launch path, that's a new bug — please file it with the flashing process name. Thanks for the contribution and the Windows attention; sorry this one got mooted at the root. |
Summary
windows_hide_flags()helper._run_bash()forwarding behavior.Root cause
When the Windows desktop gateway runs as
pythonw.exe, SSH backend status/output polling launches console-modessh.exechildren withoutCREATE_NO_WINDOW. Windows Terminal is configured as the default console host, so each short-lived SSH probe creates a visibleOpenConsole.exewindow. A background gateway loop polling/tmp/hermes_bg_proc_*.logand.pidtherefore produced hundreds of orphaned console windows.Tests
uv run --extra dev python -m pytest tests\\tools\\test_ssh_environment.py -q16 passed, 11 skippedDeployment status
pythonw.exe -m hermes_cli.main gateway runprocess and cleaned up orphanedOpenConsole.exe/conhost.exewindows.C:\\Users\\Benjamin\\AppData\\Local\\hermes\\hermes-agenthas been synced with the production-code portion of this fix.69476; status reports Telegram and Signal connected.OpenConsole.exeand no currentssh.exeprocesses.