Skip to content

fix(windows): hide the console windows of spawned child processes - #1448

Open
mlandolfi90 wants to merge 1 commit into
DeusData:mainfrom
mlandolfi90:fix/hide-daemon-child-windows
Open

fix(windows): hide the console windows of spawned child processes#1448
mlandolfi90 wants to merge 1 commit into
DeusData:mainfrom
mlandolfi90:fix/hide-daemon-child-windows

Conversation

@mlandolfi90

Copy link
Copy Markdown

Two CreateProcessW call sites in src/foundation/ spawn children without CREATE_NO_WINDOW, so on Windows each one flashes a console window:

  • cbm_subprocess_spawn_win (src/foundation/subprocess.c) — the supervisor → index-worker spawn.
  • cbm_popen_isolated (src/foundation/compat_fs.c).

src/daemon/bootstrap.c already passes the flag for the daemon self-spawn, so this brings the remaining two in line with it.

User-visible effect: when the MCP server is driven by an editor/agent over stdio, indexing a repository pops console windows onto the desktop — one per worker spawn. Nothing breaks, but on a machine that reindexes on file changes it is a steady stream of windows stealing focus.

CREATE_NO_WINDOW only suppresses console allocation; it does not detach the process, change the process group, or affect the inherited handle list, so the existing EXTENDED_STARTUPINFO_PRESENT | CREATE_SUSPENDED | CREATE_NEW_PROCESS_GROUP semantics and the worker-log handle plumbing are untouched.

🤖 Generated with Claude Code

@mlandolfi90
mlandolfi90 requested a review from DeusData as a code owner August 4, 2026 19:09
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Thanks for opening this — it has been seen, and it is queued.

This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence.

Current review status: working through a backlog. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

If this fixes a bug, a reproduction we can run is worth more than a description of the symptom.

Thanks for contributing, and sorry in advance for the wait.

Signed-off-by: mlandolfi90 <mlandolfi90@users.noreply.github.com>
@mlandolfi90
mlandolfi90 force-pushed the fix/hide-daemon-child-windows branch from 795797c to 9354930 Compare August 5, 2026 06:14
@rkisedu

rkisedu commented Aug 6, 2026

Copy link
Copy Markdown

Windows reproduction (focus-steal) — confirms this PR is needed

Host: Windows 11, codebase-memory-mcp 0.9.0, Cursor + Claude Code MCP stdio.

Symptom: With auto_watch=true (default), background git probes spawn visible cmd.exe / OpenConsole.exe ~every 1–2s. Windows steal keyboard focus — typing in the editor is interrupted continuously until the MCP/index workers are killed.

Mitigation that works today:

codebase-memory-mcp config set auto_watch false
codebase-memory-mcp config set auto_index false

Query tools remain usable; only continuous watch/reindex is unsafe until CREATE_NO_WINDOW lands on the two CreateProcessW sites this PR patches (cbm_subprocess_spawn_win, cbm_popen_isolated).

Ask: Please prioritize merge/release — this is a usability blocker on Windows for anyone leaving the MCP connected with the watcher on.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants