fix: add missing creationflags to subprocess calls (Windows console flash) - #71823
Closed
JonthanaHanh wants to merge 1 commit into
Closed
fix: add missing creationflags to subprocess calls (Windows console flash)#71823JonthanaHanh wants to merge 1 commit into
JonthanaHanh wants to merge 1 commit into
Conversation
…lash) browser_tool.py: Chromium auto-install subprocess.run was missing creationflags=windows_hide_flags(), causing a console window flash on Windows during the one-time browser binary download. tts_tool.py: Piper voice download subprocess.run was missing creationflags, causing a console window flash on Windows during first-use voice model download. whatsapp/adapter.py: Three subprocess.run calls were missing creationflags: taskkill in _terminate_bridge_process, node --version probe, and npm install during bridge setup. All cause console window flashes on Windows. The file already imported windows_detach_popen_kwargs but not windows_hide_flags; added the import and creationflags to all three call sites.
Collaborator
Contributor
|
Thanks for tracing the remaining browser, Piper, and WhatsApp subprocess sites and using the established helper consistently. Automated hermes-sweeper review found the requested no-flash behavior is already implemented on current
Closing as implemented on main. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds missing
creationflags=windows_hide_flags()to three files wheresubprocess.runcalls on Windows spawn visible console windows (cmd.exe / conhost.exe flash).Changes
tools/browser_tool.py— Chromium auto-install (npx agent-browser install):tools/tts_tool.py— Piper voice download:python -m piper.download_voiceswas missing creationflags.plugins/platforms/whatsapp/adapter.py— Three call sites:_terminate_bridge_processtaskkill (line ~223) — Windows-only path to kill the bridge process treenode --versionduring bridge setupThe file already imported
windows_detach_popen_kwargsbut notwindows_hide_flags; added the import alongside it.Why these are real bugs
On Windows, every
subprocess.run/subprocess.PopenwithoutCREATE_NO_WINDOW(0x08000000) spawns a visible console window that flashes briefly. Thewindows_hide_flags()helper returns this flag on Windows and 0 on other platforms, so it's safe to pass unconditionally.Pattern coverage
Existing PRs cover most other subprocess sites:
These three files were gaps in the coverage. No existing PR touches them.
Test plan
python3 -c "import ast; ast.parse(open(f).read())"for all 3 fileswindows_hide_flags()returns 0 on non-Windows — no behavioral change on Linux/macOS