Skip to content

fix(whatsapp): prevent reconnect console flashes on Windows - #63288

Closed
BlackishGreen33 wants to merge 1 commit into
NousResearch:mainfrom
BlackishGreen33:bg/fix-whatsapp-console-flash-63212
Closed

fix(whatsapp): prevent reconnect console flashes on Windows#63288
BlackishGreen33 wants to merge 1 commit into
NousResearch:mainfrom
BlackishGreen33:bg/fix-whatsapp-console-flash-63212

Conversation

@BlackishGreen33

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes #63212.

Prevents visible console windows from flashing during WhatsApp reconnects on Windows. The long-running bridge process was already started with the correct detached-process helper, but three short-lived subprocesses still ran without CREATE_NO_WINDOW:

  • the node --version requirements check
  • the bridge dependency npm install
  • the taskkill bridge cleanup

This change uses the existing windows_hide_flags() helper for those calls. It does not change command arguments, timeouts, output capture, process cleanup, or non-Windows behavior.

Related Issue

Fixes #63212

Type of Change

  • Bug fix
  • Tests

Changes Made

  • Apply windows_hide_flags() to the three short-lived WhatsApp subprocess calls.
  • Reuse the same helper already used by the Windows port-cleanup path.
  • Add focused regression coverage for the Node probe, npm install, and bridge taskkill calls.

How to Test

/Users/blackishgreen03/workspace/hermes-agent/venv/bin/python -m pytest tests/gateway/test_whatsapp_connect.py -q
# 30 passed

/Users/blackishgreen03/workspace/hermes-agent/venv/bin/python -m pytest tests/tools/test_windows_native_support.py -q -k SubprocessCompatHelpers
# 8 passed, 58 deselected

git diff --check

The tests mock the Windows flag value and verify that all three subprocess calls receive it. I ran the focused tests on macOS; I did not claim a separate Windows machine test. The source issue includes real Windows process/window monitoring for the same change.

Checklist

  • Searched for existing PRs by issue number and implementation keywords.
  • Kept the PR limited to the WhatsApp adapter and focused tests.
  • Added regression coverage for every changed subprocess path.
  • Confirmed the shared helper returns 0 on non-Windows platforms.
  • No config, dependency, documentation, or tool schema changes are required.

Copilot AI review requested due to automatic review settings July 12, 2026 16:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins platform/whatsapp WhatsApp Business adapter platform/windows Native Windows-specific behavior or breakage P3 Low — cosmetic, nice to have sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows labels Jul 12, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks—this is a focused fix for a verified Windows reconnect gap.

Current main still invokes the synchronous taskkill, Node version probe, and npm-install subprocesses without creation flags at plugins/platforms/whatsapp/adapter.py:223, :349, and :546. The PR applies windows_hide_flags() to precisely those paths. That helper is designed for synchronous console utilities while retaining captured stdio and is a no-op outside Windows (hermes_cli/_subprocess_compat.py:186-201). The remaining adapter subprocess sites are already hidden on Windows, POSIX-only, or use the existing detached bridge helper.

This is an automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users label Jul 16, 2026
@teknium1

Copy link
Copy Markdown
Contributor

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.

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 P3 Low — cosmetic, nice to have platform/whatsapp WhatsApp Business adapter platform/windows Native Windows-specific behavior or breakage sweeper:blast-contained Sweeper blast radius: contained — one narrow path / opt-in / few users 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.

WhatsApp reconnect loop flashes Windows Terminal windows on every retry

4 participants