fix(whatsapp): hide Windows console flashes on bridge helper spawns - #76122
Closed
686f6c61 wants to merge 1 commit into
Closed
fix(whatsapp): hide Windows console flashes on bridge helper spawns#76122686f6c61 wants to merge 1 commit into
686f6c61 wants to merge 1 commit into
Conversation
node --version, taskkill, and npm install were spawned without CREATE_NO_WINDOW from the windowless pythonw gateway parent, so each reconnect flashed a visible Windows Terminal console. Pass windows_hide_flags() on those three call sites (no-op on POSIX). Fixes NousResearch#75628
Contributor
Author
|
Closing this one — I am going to stick to changes I can fully own and verify end-to-end on Linux/Docker (agent core, CLI, tests). The WhatsApp Windows console-flash path needs a real Windows gateway environment to validate properly, so I will leave it for someone who can dogfood that stack. Happy to reopen later if that becomes available. |
Collaborator
Contributor
Author
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.
What does this PR do?
On Windows the WhatsApp gateway runs under windowless
pythonw.exe. Three helper spawns still used the default console creation flags, so each reconnect flashed a visible Windows Terminal window for ~100–150 ms:node --versionincheck_whatsapp_requirements()(every bridge start)taskkillin_terminate_bridge_process()(every terminate/reconnect)npm install --silentwhen bridge deps reinstallThe bridge process itself already uses
windows_detach_popen_kwargs(), and_kill_port_process()already passeswindows_hide_flags(). These three sites were simply missed.Fix
Pass
creationflags=windows_hide_flags() if _IS_WINDOWS else 0on those threesubprocess.runcalls.windows_hide_flags()is a documented no-op on POSIX.Related Issue
Fixes #75628
Type of Change
Changes Made
plugins/platforms/whatsapp/adapter.py— hide flags on the three call sitestests/gateway/test_whatsapp_windows_hide_flags.py— assert creationflags on Windows paths and 0 on POSIXHow to Test
Docker (
uv+ Python 3.12): 3/3 passed.On a real Windows host with WhatsApp gateway + Windows Terminal as default console host, restart the gateway and confirm no console flash during reconnect (the issue reports a WinEvent hook as verification).
Checklist
Notes
I left
hermes_cli/clipboard.pyalone even though the issue body sketched similar hide flags there — that is a separate surface and this PR stays scoped to the WhatsApp reconnect flashes.