fix(mcp): suppress Windows console window on MCP subprocess spawn - #41078
Closed
Chameleon-Chaos wants to merge 8 commits into
Closed
fix(mcp): suppress Windows console window on MCP subprocess spawn#41078Chameleon-Chaos wants to merge 8 commits into
Chameleon-Chaos wants to merge 8 commits into
Conversation
fix(logging): best-effort rotation with cooldown for Windows file-lock contention
The file was incorrectly replaced with 'PLACEHOLDER' in commit b3c16f4. Restoring the full 218-line implementation with browser CDP helpers.
On Windows, npx/Node.js MCP servers (and any .cmd wrapper) pop a console window when Hermes spawns them as subprocesses. The MCP SDK already passes CREATE_NO_WINDOW to anyio.open_process, but a broad except Exception in mcp/os/win32/utilities.py falls back to creationflags=0, which lets the window appear. This monkey-patch wraps create_windows_process so that CREATE_NO_WINDOW always survives any exception path — either via anyio.open_process with the flag, or via subprocess.Popen (the fallback) which also carries it. Closes: NousResearch#38101
youjunxiaji
added a commit
to youjunxiaji/hermes-agent
that referenced
this pull request
Jun 16, 2026
…site Guards against the PR NousResearch#41078 regression where create_windows_process was patched only on mcp.os.win32.utilities, leaving the name imported into mcp.client.stdio (the real call site) unpatched. Windows-only; skips on other platforms. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
10 tasks
19 tasks
Contributor
|
Closing as superseded by the consolidated Windows console-flash work tracked in #54220. The relevant pieces from this PR/cluster have now landed through the targeted follow-up PRs #54236, #53892, and #54417, or are recorded in the umbrella tracker for any remaining native-Windows verification. Keeping this separate PR open would duplicate the tracker and the merged follow-up work. Thanks for digging into this — the reports and PRs in this cluster helped identify the remaining spawn legs. |
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.
On Windows, npx/Node.js MCP servers pop a console window when Hermes spawns them as subprocesses. The MCP SDK already passes CREATE_NO_WINDOW to anyio.open_process, but a broad except Exception in mcp/os/win32/utilities.py falls back to creationflags=0.
This monkey-patch wraps create_windows_process so that CREATE_NO_WINDOW always survives any exception path.
Refs: PR #38100 (pythonw.exe)