Skip to content

windowsHide: true missing in npm-shim.js spawnSync calls — console window flashes on Windows #1092

Description

@luoyerr

On Windows, when CodeGraph is running as an MCP server (launched by Claude Code), a console (cmd) window briefly flashes occasionally. This is a cosmetic issue but distracting.

Root cause

Three spawn/spawnSync calls are missing windowsHide: true:

1. npm-shim.js:48 — The main spawn that launches the bundled node.exe. Runs every time the MCP server starts or reconnects after the daemon idles out.

var res = childProcess.spawnSync(resolved.command, resolved.args, { stdio: "inherit" });

2. npm-shim.js:224 — The self-heal extraction via tar (missing platform bundle):

var res = childProcess.spawnSync("tar", args, { stdio: "ignore" });

3. src/extraction/wasm-runtime-flags.ts — The relaunchWithWasmRuntimeFlagsIfNeeded re-execs node:

const result = spawnSync(process.execPath, argv, { stdio: "inherit" });

Note: mcp/index.ts's spawnDetachedDaemon already correctly sets windowsHide: true — handled during the #411 daemon refactor but the other spawnSync sites were missed.

Environment:

  • Windows 11
  • @colbymchenry/codegraph v0.9.6
  • Launched as MCP stdio server via Claude Code

Expected: No console window appears during background process spawning.
Actual: A black console window (conhost.exe) flashes briefly.

Fix: Add windowsHide: true to the spawnSync options object at all three locations above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions