Skip to content

fix(whatsapp): hide Windows console flashes on bridge helper spawns - #76122

Closed
686f6c61 wants to merge 1 commit into
NousResearch:mainfrom
686f6c61:fix/75628-whatsapp-hide-console-windows
Closed

fix(whatsapp): hide Windows console flashes on bridge helper spawns#76122
686f6c61 wants to merge 1 commit into
NousResearch:mainfrom
686f6c61:fix/75628-whatsapp-hide-console-windows

Conversation

@686f6c61

@686f6c61 686f6c61 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

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:

  1. node --version in check_whatsapp_requirements() (every bridge start)
  2. taskkill in _terminate_bridge_process() (every terminate/reconnect)
  3. npm install --silent when bridge deps reinstall

The bridge process itself already uses windows_detach_popen_kwargs(), and _kill_port_process() already passes windows_hide_flags(). These three sites were simply missed.

Fix

Pass creationflags=windows_hide_flags() if _IS_WINDOWS else 0 on those three subprocess.run calls. windows_hide_flags() is a documented no-op on POSIX.

Related Issue

Fixes #75628

Type of Change

  • Bug fix
  • Cross-platform / Windows
  • Tests

Changes Made

  • plugins/platforms/whatsapp/adapter.py — hide flags on the three call sites
  • tests/gateway/test_whatsapp_windows_hide_flags.py — assert creationflags on Windows paths and 0 on POSIX

How to Test

pytest tests/gateway/test_whatsapp_windows_hide_flags.py -v

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.py alone 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.

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
@686f6c61

686f6c61 commented Aug 1, 2026

Copy link
Copy Markdown
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.

@686f6c61 686f6c61 closed this Aug 1, 2026
@686f6c61
686f6c61 deleted the fix/75628-whatsapp-hide-console-windows branch August 1, 2026 11:37
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins platform/whatsapp WhatsApp Business adapter platform/windows Native Windows-specific behavior or breakage sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows duplicate This issue or pull request already exists labels Aug 1, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Duplicate of #75224: both patches add Windows hide flags to the same WhatsApp node-version, taskkill, and npm helper spawns. #76122 also adjusts encoding/test style, but does not provide a distinct user-visible repair.

@686f6c61

686f6c61 commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

Agreed — this is a duplicate of #75224 (same three WhatsApp helper spawns + hide flags). Leaving #75224 as the fix path; no further work from me here.

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

Labels

comp/plugins Plugin system and bundled plugins duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have platform/whatsapp WhatsApp Business adapter platform/windows Native Windows-specific behavior or breakage 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.

[Windows] WhatsApp gateway flashes visible console windows (node --version / taskkill / npm install) on bridge reconnect cycles

2 participants