fix(appcontainer): suppress empty console window for piped sandbox children#569
Merged
Merged
Conversation
…ildren The Windows ProcessContainer backends (BaseContainer + AppContainer) launched console-subsystem children (pwsh, cmd, rg, LSP shims, MCP stdio servers, …) without CREATE_NO_WINDOW. On a headless host with piped stdio — the in-process mxc-sdk streaming path now used by copilot-agent-runtime — Windows allocates a new console that briefly flashes on screen even though stdio is redirected. Set CREATE_NO_WINDOW on both spawn paths (including BaseContainer's env-not-supported retry) when stdio is piped. The pipe_mode guard is essential: in console-sharing (ConPTY) mode the child inherits the parent's live console for interactive I/O, where CREATE_NO_WINDOW must not be set. The mxc-sdk always streams over pipes, so it gets windowless spawns with no API or consumer change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents brief “empty console window” flashes when the Windows ProcessContainer backends (BaseContainer + AppContainer) spawn console-subsystem children with piped stdio (the mxc-sdk streaming path). It does so by conditionally adding CREATE_NO_WINDOW to the process creation flags only when pipe_mode is active, preserving ConPTY/console-sharing behavior for interactive runs.
Changes:
- Add
CREATE_NO_WINDOWto BaseContainer child creation flags whenpipe_modeis true (including the env-not-supported retry path). - Add
CREATE_NO_WINDOWto AppContainerCreateProcessWflags whenpipe_modeis true.
Show a summary per file
| File | Description |
|---|---|
| src/backends/appcontainer/common/src/base_container_runner.rs | ORs CREATE_NO_WINDOW into BaseContainer process creation flags when pipe_mode is enabled, including retry without env block. |
| src/backends/appcontainer/common/src/appcontainer_runner.rs | ORs CREATE_NO_WINDOW into AppContainer CreateProcessW flags when pipe_mode is enabled. |
Copilot's findings
- Files reviewed: 2/2 changed files
- Comments generated: 0
MGudgin
approved these changes
Jun 25, 2026
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.
📖 Description
The Windows ProcessContainer backends (BaseContainer + AppContainer) launched
console-subsystem children (e.g.
pwsh,cmd,rg, …)without
CREATE_NO_WINDOW. On a headless host with piped stdio Windowsallocates a new console that briefly flashes on screen, even though stdio is
redirected via pipes (
STARTF_USESTDHANDLES).This sets
CREATE_NO_WINDOWon both spawn paths (base_container_runnerandappcontainer_runner, including BaseContainer's env-not-supported retry) whenstdio is piped:
The
pipe_modeguard is essential: in console-sharing (ConPTY) mode the childinherits the parent's live console for interactive I/O, where
CREATE_NO_WINDOWmust not be set (it would detach the child and break the interactive shell). The
mxc-sdkstreaming dispatch always spawns withStdioMode::Pipes, sopipe_modeis always true for SDK callers.
🔗 References
n/a
🔍 Validation
cargo fmt --all -- --check,cargo clippy -p wxc_common -p mxc-sdk --all-targets -- -D warnings, andcargo test -p wxc_common -p mxc-sdkpass on the pinned1.93toolchain.cfg(windows)-gated and can't be compiled on macOS; the change only conditionally OR-sCREATE_NO_WINDOWinto the existing creation flags and was matched againstrustfmtoutput. Windows build/test coverage comes from CI.✅ Checklist
📋 Issue Type
Microsoft Reviewers: Open in CodeFlow