Skip to content

[0.159] Backport Windows console suppression for 0.159.2 - #49385

Merged
andrewgu-oai merged 2 commits into
release/0.159from
release/0.159.2-windows-console
Sep 29, 2026
Merged

andrewgu-oai merged 2 commits into
release/0.159from
release/0.159.2-windows-console

Conversation

@andrewgu-oai

Copy link
Copy Markdown
Contributor

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 --check passes. 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.

## 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
andrewgu-oai marked this pull request as ready for review September 29, 2026 22:45
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-09-29T22:46:27.133442Z c49a50b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@andrewgu-oai
andrewgu-oai merged commit 2851358 into release/0.159 Sep 29, 2026
35 of 44 checks passed
@andrewgu-oai
andrewgu-oai deleted the release/0.159.2-windows-console branch September 29, 2026 22:49
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants