Skip to content

Windows: missing windowsHide:true on child_process.spawn causes console window flashes #21678

@adryserage

Description

@adryserage

Description

On Windows, multiple child_process.spawn() call sites in OpenClaw's dist bundle do not set windowsHide: true. This causes visible console windows to flash briefly every time a subprocess is spawned (e.g., during mDNS/Bonjour discovery via �rp -a, exec tool calls, plugin sandboxes, etc.).

Current State

Some spawn sites already include the fix — notably in the main
unExec path (exec-*.js). However, many other files that call spawn() do not:

Files with spawn() but no windowsHide (non-exhaustive, from v2026.2.19-2):

  • entry.js
  • gateway-cli-*.js
  • sandbox-*.js
  • chrome-*.js
  • qmd-manager-*.js
  • �gent-scope-*.js
  • pi-embedded-helpers-*.js
  • send-*.js
  • update-cli-*.js
  • webhooks-cli-*.js
  • workspace-*.js
  • �cp-cli-*.js

Files that already have it (good):

  • exec-CBKBIMpA.js / exec-DYqRzFbo.js (main exec path)

eply-*.js

  • service-*.js
  • subagent-registry-*.js
  • with-timeout-*.js

Expected Behavior

All child_process.spawn() calls on Windows should include windowsHide: true in their options to prevent console window flashes.

Suggested Fix

The most robust approach would be to:

  1. Centralize: Create a shared spawn wrapper (e.g., spawnHidden()) that always injects windowsHide: true on process.platform === 'win32'.
  2. Apply universally: Use this wrapper in all spawn call sites, including spawnWithFallback.
  3. This avoids the current pattern where each call site has to remember to set the option.

Alternatively, spawnWithFallback could force windowsHide: true into �aseOptions when on Windows, which would cover its callers automatically.

Workaround

Currently, users must manually patch the dist files after every
pm update:
js // Add windowsHide: true to spawn options in each affected file spawn(cmd, args, { ...options, windowsHide: true })

This is fragile and gets overwritten on every update.

Environment

  • OS: Windows 10 (x64)
  • OpenClaw: v2026.2.19-2 (npm)
  • Node: v24.5.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions