Repository navigation
[0.159] Backport Windows console suppression for 0.159.2 - #49385
Merged
Merged
Conversation
## Why Background helpers launched from a detached Windows process can allocate console windows. Job Object launches and containment fallbacks need to preserve console suppression as well. ## What changed - Add `codex_utils_process::background_command` to set `CREATE_NO_WINDOW` on Windows, and use it across background subprocess launches, including Git, plugins, authentication, diagnostics, and sandbox helpers. - Centralize console suppression in Job Object launches. Keep `CREATE_NO_WINDOW` when retrying without containment, and clear `CREATE_SUSPENDED` so the fallback child can run. - Preserve console inheritance for interactive shell launches and interactive AWS authentication refreshes. ## Testing Add Windows regression tests covering console-free launches from detached parents through standard and Tokio commands, stdout/stderr capture, successful containment, Job Object creation and assignment failures, and sandbox setup refresh helpers. GitOrigin-RevId: b2c238fa7d4f9fbd868e5adf7d4be9958ff01e6c (cherry picked from commit fbc1698)
## What changed Use `ConsoleMode::NoWindow` for legacy Windows sandbox capture and non-TTY unified execution, enabling `CREATE_NO_WINDOW` for these piped processes. ## Testing Extend the PowerShell interrupt and capture tests to assert that `GetConsoleWindow()` returns null before checking process termination and descendant survival. GitOrigin-RevId: dcc3b5554986ab0280748e5fa7080d36ded3d673 (cherry picked from commit 50d9c5d)
andrewgu-oai
marked this pull request as ready for review
September 29, 2026 22:45
Contributor
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport #49164 and #49308 onto the content commit of 0.159.1 to suppress Windows console flashing reported in #48074. The two cherry-picks applied without conflicts; no other fixes are included. Cargo remains at the release-branch content version, 0.0.0.
Validation:
git diff --checkpasses. Native Windows execution has not been validated on this exact candidate. Keep this PR in draft pending required review and a focused Windows smoke test: from a non-elevated PowerShell host with workspace-write and the unelevated sandbox, verify built-ins and external whoami.exe, cmd.exe, Git and nested PowerShell terminate with expected output, both with a matching managed daemon and with --no-daemon, without visible console flashes. Record exact binary/candidate SHA, CLI and daemon versions, CODEX_HOME, configuration, exit codes and durations.The alpha.2 reports in #48074 (comment) and #48074 (comment) conflict on execution safety; they do not establish a causal regression or validate this exact backport. Do not publish 0.159.2 until the evidence and required checks/review are complete.