Skip to content

[Windows][26.825.6671.0] Main Chromium HWND is created hidden; ShowWindow immediately restores the UI #41696

Open

Description

@HEYWEIREN

What version of the Codex App are you using (From “About Codex” dialog)?

OpenAI.Codex 26.825.6671.0 (Microsoft Store MSIX)

Package identity:

OpenAI.Codex_26.825.6671.0_x64__2p2nqsd0c76g0
Status: Ok
SignatureKind: Store

The packaged ChatGPT.exe reports Chromium file/product version 151.0.7922.174.

What subscription do you have?

Not relevant to this local pre-UI startup failure; the exact account tier was not verified.

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64
Windows 11 25H2, build 26200.9168

Display adapters present:

NVIDIA GeForce RTX 4060 Laptop GPU — driver 32.0.15.9200
Intel UHD Graphics — driver 32.0.101.6790

The older OpenAI.ChatGPT-Desktop 1.2026.190.0 Store package is also installed side-by-side. The affected process path is unambiguously the OpenAI.Codex_26.825.6671.0 package.

What issue are you seeing?

Summary

Launching the Windows Codex desktop app starts a responsive Chromium process tree, but no application appears in Alt+Tab or on the taskbar. PowerShell reports MainWindowHandle = 0, and initially there are no renderer processes.

The important new diagnostic is that a valid top-level Chromium HWND has already been created. It is on-screen and has normal dimensions, but it remains hidden:

Owner PID: main packaged ChatGPT.exe
Class: Chrome_WidgetWin_0
Visible: False
Title: <empty>
Rect: 69,69,922,559

Calling Win32 ShowWindow(hwnd, SW_SHOW) followed by SetForegroundWindow(hwnd) immediately changes the application state:

  • the native window becomes visible;
  • multiple --type=renderer processes are spawned;
  • the window title becomes ChatGPT;
  • the application becomes usable;
  • no reset, reinstall, cache deletion, or configuration change is required.

This indicates that AppX activation and native window creation both succeed, but the startup lifecycle fails to transition an already-created BrowserWindow/HWND from hidden to visible. MainWindowHandle = 0 is misleading here because .NET returns the main visible top-level window; direct Win32 enumeration proves that the hidden top-level window exists.

Process state before forcing the window visible

main ChatGPT.exe             running, Responding=True, MainWindowHandle=0
crashpad-handler             running
crashpad-handler             running
gpu-process                  running
network utility              running
storage utility              running
renderer                     NOT PRESENT

The main process remained active and consumed approximately 1.73 CPU seconds during a two-second sample, consistent with a high-CPU startup spin rather than an exited process.

The main process was launched through normal AppX activation with explorer.exe as its parent. Its command line contained no --hidden or start-minimized argument.

Process state immediately after ShowWindow

main ChatGPT.exe             MainWindowHandle != 0, title = ChatGPT
renderer                     spawned (multiple processes)
gpu-process                  still running
network/storage utilities    still running
application UI               visible and usable

The renderer processes appeared only after the existing hidden native window was shown.

Windows and package evidence

AppModel-Runtime recorded successful activation rather than an AppX launch failure:

Event 201: Created process for OpenAI.Codex_2p2nqsd0c76g0!App
Event 210: Created Desktop AppX container
Event 211: Added process to Desktop AppX container

No matching events were found in the Application log for:

Application Error 1000
Windows Error Reporting 1001
Application Hang 1002

The active Crashpad profile contained no crash report for this startup.

Checks that did not identify the cause

  • AppX package status is Ok.
  • The main window rectangle is valid and on-screen, so this is not an off-screen saved-bounds problem.
  • config.toml does not contain approval_policy = "untrusted".
  • No persisted ELECTRON_*, CHROME_*, NODE_OPTIONS, OZONE, or ANGLE environment override exists in HKCU/HKLM.
  • There are no AppCompat layer flags for the packaged ChatGPT.exe.
  • GPU and utility processes start normally.
  • There is no crash, WER, or AppModel activation failure.
  • Repair/reset/reinstall-style explanations do not fit the observed recovery: showing the already-existing HWND restores the same running process immediately.

Why this report is distinct from related reports

There are several related headless-startup reports, including #41523, #41096, #41482, #41073, and #38766. Most infer that a window has not yet been created because MainWindowHandle = 0, or focus on updater/runtime extraction delays.

This report adds a narrower and directly observed state transition:

  1. the main native Chrome_WidgetWin_0 already exists with valid bounds;
  2. it is specifically hidden (IsWindowVisible == false);
  3. showing that same HWND immediately triggers renderer creation and restores the UI.

A shorter version of this diagnostic was also added to #41523. This standalone report consolidates the full environment, exclusions, reproduction evidence, and suggested engineering checks so the hidden-window lifecycle failure can be tracked independently.

What steps can reproduce the bug?

  1. Install or update the Microsoft Store Codex app to 26.825.6671.0.
  2. Launch Codex from the Start menu.
  3. Observe that several packaged ChatGPT.exe processes start, but no UI appears and the app is absent from Alt+Tab.
  4. Confirm the initial process state:
Get-CimInstance Win32_Process |
  Where-Object {
    $_.Name -eq 'ChatGPT.exe' -and
    $_.ExecutablePath -like '*OpenAI.Codex*'
  } |
  Select-Object ProcessId, ParentProcessId, CommandLine

Get-Process ChatGPT |
  Select-Object Id, Responding, MainWindowHandle, MainWindowTitle, CPU
  1. Enumerate all top-level windows with Win32 EnumWindows, filter by the packaged main-process PID, and inspect GetClassName, IsWindowVisible, and GetWindowRect.
  2. Observe the hidden Chrome_WidgetWin_0 with a normal on-screen rectangle.
  3. Call ShowWindow(hwnd, SW_SHOW) and SetForegroundWindow(hwnd) for that window.
  4. Observe that the UI appears immediately and renderer processes are created.

A minimal PowerShell diagnostic/recovery sample is below. It deliberately targets only the main ChatGPT.exe whose executable path belongs to OpenAI.Codex:

PowerShell Win32 window enumeration and diagnostic ShowWindow call
Add-Type @'
using System;
using System.Text;
using System.Runtime.InteropServices;

public static class CodexWindowProbe {
    public delegate bool EnumWindowsProc(IntPtr hwnd, IntPtr lParam);

    [DllImport("user32.dll")]
    public static extern bool EnumWindows(EnumWindowsProc callback, IntPtr lParam);

    [DllImport("user32.dll")]
    public static extern uint GetWindowThreadProcessId(IntPtr hwnd, out uint processId);

    [DllImport("user32.dll")]
    public static extern int GetClassName(IntPtr hwnd, StringBuilder text, int maxCount);

    [DllImport("user32.dll")]
    public static extern bool IsWindowVisible(IntPtr hwnd);

    [DllImport("user32.dll")]
    public static extern bool ShowWindow(IntPtr hwnd, int command);

    [DllImport("user32.dll")]
    public static extern bool SetForegroundWindow(IntPtr hwnd);
}
'@

$main = Get-CimInstance Win32_Process |
  Where-Object {
    $_.Name -eq 'ChatGPT.exe' -and
    $_.ExecutablePath -like '*OpenAI.Codex*' -and
    $_.CommandLine -notmatch '--type='
  } |
  Select-Object -First 1

[CodexWindowProbe]::EnumWindows({
    param($hwnd, $lParam)

    $ownerPid = 0
    [CodexWindowProbe]::GetWindowThreadProcessId($hwnd, [ref]$ownerPid) | Out-Null

    if ($ownerPid -eq $main.ProcessId) {
        $className = [Text.StringBuilder]::new(256)
        [CodexWindowProbe]::GetClassName($hwnd, $className, 256) | Out-Null

        if ($className.ToString() -eq 'Chrome_WidgetWin_0') {
            [pscustomobject]@{
                PID = $ownerPid
                Handle = ('0x{0:X}' -f $hwnd.ToInt64())
                VisibleBefore = [CodexWindowProbe]::IsWindowVisible($hwnd)
            }

            # Diagnostic intervention used in this report:
            [CodexWindowProbe]::ShowWindow($hwnd, 5) | Out-Null # SW_SHOW
            [CodexWindowProbe]::SetForegroundWindow($hwnd) | Out-Null
        }
    }

    return $true
}, [IntPtr]::Zero) | Out-Null

The exact trigger may be tied to the first launch after an automatic update. The failure was observed after the package was updated on the same day. The window-level state and immediate recovery are deterministic once the app is in the affected headless state.

What is the expected behavior?

The desktop app should always make its main window visible after successful AppX activation and native window creation.

If pre-renderer initialization, updater policy, runtime extraction, shell-environment discovery, or another startup gate must complete first, the app should display a bounded splash/progress/recovery window rather than leave a fully hidden top-level window and high-CPU background process indefinitely.

If the intended ready-to-show transition does not occur within a bounded interval, the app should recover by showing the existing main window with an actionable loading/error state.

Additional information

Suggested engineering checks:

  1. Log native BrowserWindow/HWND creation separately from renderer creation, did-finish-load, ready-to-show, and the final show() call.
  2. Record the reason whenever the main window remains hidden after AppX activation.
  3. Check whether a startup prerequisite is waiting for visibility while visibility itself waits for ready-to-show, creating a circular dependency.
  4. Check the automatic-update / first-launch path for a missed or deferred show() call.
  5. Add a bounded watchdog: if a valid main HWND exists but stays hidden and no renderer becomes ready, show a minimal recovery UI instead of remaining headless.
  6. Consider emitting a Windows-specific startup diagnostic event containing HWND-created, HWND-visible, renderer-created, and ready-to-show timestamps.

Related issues:

Privacy: this report intentionally excludes usernames, account identifiers, Windows SIDs, local project paths, conversation content, session transcripts, raw browser-profile data, and complete logs. Additional sanitized diagnostics can be provided if requested.

Activity

  1. added
    bug
    app
    windows-os
    on Aug 30, 2026
  2. Ed93RUnner commented on Aug 31, 2026

    @Ed93RUnner

    Additional reproduction on Windows with Microsoft Store package OpenAI.Codex 26.825.6671.0 (x64).

    Observed before recovery:

    • Main packaged ChatGPT.exe process had no --type= argument.
    • Child processes included crashpad, GPU, NetworkService, and StorageService, but no --type=renderer processes.
    • Get-Process ChatGPT showed MainWindowHandle = 0 for all processes.
    • Direct Win32 enumeration of the main process found a top-level Chrome_WidgetWin_0 HWND while the UI was not visible.

    Recovery behavior in this reproduction was slightly different from the issue description:

    1. A direct synchronous ShowWindow(hwnd, SW_SHOW) call blocked for a while instead of returning immediately.
    2. In a second PowerShell process, ShowWindowAsync(hwnd, SW_SHOW) returned True, but IsWindowVisible(hwnd) was still False after 2 seconds.
    3. The original synchronous ShowWindow call eventually returned, and at that moment the Codex/ChatGPT UI appeared.
    4. After the UI appeared, multiple ChatGPT.exe --type=renderer child processes were present.

    This further suggests the native HWND is created but the startup/UI thread is stuck before completing the hidden->visible transition and renderer startup. No app reset, reinstall, cache deletion, or package repair was needed for this recovery.

  3. ZLv69 commented on Sep 3, 2026

    @ZLv69

    Confirmed a closely related hidden-window state on a newer Windows MSIX build: 26.831.2377.0.

    Observed before recovery:

    • AppX package status: Ok
    • main packaged ChatGPT.exe: running / responsive
    • child processes: crashpad, GPU, utility
    • no --type=renderer
    • MainWindowHandle = 0
    • direct Win32 enumeration found a top-level Chrome_WidgetWin_0 with Visible=False

    One important difference from the original report: synchronous ShowWindow(hwnd, SW_SHOW) did not return immediately on this reproduction. It blocked while the app was still in its post-update startup work. ShowWindowAsync returned, but the window remained effectively unusable and no renderer appeared.

    During the same interval, a new CUA Node runtime under %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\<hash> was being materialized. On this run:

    • materialization duration: ~11m21s
    • resulting runtime: 4,684 files / ~322.01 MiB
    • bin\node.exe: present
    • bin\node_repl.exe: present

    Only after runtime preparation completed did renderer processes and the bundled codex.exe ... app-server appear. The blocked synchronous ShowWindow then returned and the UI became available.

    Another observation: forcing the hidden HWND visible early could expose a black Chromium host window. That did not mean the application was fully ready; message sending / app-server readiness still depended on the rest of startup completing. After the runtime was fully materialized, a clean restart was normal.

    So on this machine the hidden Chrome_WidgetWin_0 is real, but it appears coupled to a longer main-thread/startup stall rather than always being only a missed final show() call.

    This may be useful for distinguishing:

    1. “HWND exists but final show transition is missed”, from
    2. “HWND exists hidden while the Electron main process is blocked by pre-renderer initialization”.

    No installed package files, runtime files, registry settings, or auth data were modified during this diagnosis. Local paths/identifiers are omitted.

  4. HEYWEIREN commented on Sep 8, 2026

    @HEYWEIREN
    Author

    Recurrence on 26.901.6511.0 (2026-09-08)

    This reproduced again on a substantially newer Windows Store/MSIX build.

    Environment

    • Windows 11 Home, x64, build 26200.9168
    • Package: OpenAI.Codex_26.901.6511.0_x64__2p2nqsd0c76g0
    • AppX package status: Ok
    • Local time zone: UTC+8

    Initial headless state

    The main packaged ChatGPT.exe process started at approximately 21:33:00 local time.

    Before recovery:

    • 6 packaged ChatGPT.exe processes were present (main/crashpad/GPU/utility services).
    • The main process was running and reported Responding=True.
    • No ChatGPT.exe --type=renderer process existed.
    • MainWindowHandle = 0.
    • Direct Win32 enumeration found a top-level Chrome_WidgetWin_0 owned by the main process with Visible=False.

    Window-recovery behavior differed from the original reproduction

    This time, merely requesting that the hidden HWND be shown was not sufficient:

    1. ShowWindowAsync(hwnd, SW_SHOW) returned True.
    2. An asynchronous SetWindowPos(..., SWP_SHOWWINDOW) request also returned True.
    3. Five seconds later, IsWindowVisible(hwnd) was still False, MainWindowHandle was still 0, and there were still no renderer processes.
    4. A synchronous ShowWindow(hwnd, SW_SHOW) diagnostic call blocked instead of returning promptly; I stopped only that diagnostic PowerShell helper.

    I then re-issued normal packaged activation through:

    explorer.exe shell:AppsFolder\OpenAI.Codex_2p2nqsd0c76g0!App
    

    I did not terminate the existing Codex/ChatGPT process tree. Within about 8 seconds:

    • the same main PID (28648) acquired a non-zero main-window handle;
    • the window title became ChatGPT;
    • IsWindowVisible=True;
    • the window was not minimized;
    • 3 renderer processes were present;
    • the UI became usable.

    Strong correlation with CUA runtime materialization

    A new runtime was populated under:

    %LOCALAPPDATA%\OpenAI\Codex\runtimes\cua_node\b474a88d5d105afa
    

    Observed metadata:

    • creation began: 2026-09-08 21:33:06.582
    • last directory write: 2026-09-08 21:39:41.521
    • duration by directory timestamps: approximately 6 minutes 35 seconds
    • files: 4,683
    • size: 337,645,136 bytes (~322 MiB)
    • bin\node.exe: present
    • bin\node_repl.exe: present
    • manifest.json: present

    The runtime-materialization interval overlaps the headless startup interval closely. This is consistent with the reports in #41822 and the broader startup/runtime-staging cluster (#42501, #41523).

    The important refinement to the original issue is that the hidden Chrome_WidgetWin_0 can be a visible symptom of a blocked pre-renderer startup path, rather than always being only a missed final show() transition. In this recurrence, forcing the HWND visible early did not complete startup; normal AppX reactivation after runtime preparation had progressed/completed restored the UI without restarting the main process.

    No app reset, reinstall, cache deletion, package/runtime modification, configuration change, or authentication-data change was performed.

  5. QianSteveLei commented on Sep 10, 2026

    @QianSteveLei

    Additional reproduction on a newer Microsoft Store/MSIX build: OpenAI.Codex 26.903.8094.0 (x64).

    Observed before recovery:

    • Package: OpenAI.Codex_26.903.8094.0_x64__2p2nqsd0c76g0
    • Launching the app created 6 ChatGPT.exe processes, but no taskbar window/UI appeared.
    • Get-Process ChatGPT | Select Id, ProcessName, CPU, MainWindowTitle, MainWindowHandle reported MainWindowHandle = 0 and an empty title for all 6 processes.
    • Direct Win32 EnumWindows enumeration found a top-level Chromium window owned by a ChatGPT.exe process:
    HWND=986220
    PID=4620
    Class=Chrome_WidgetWin_0
    Visible=False
    
    • DWM inspection succeeded and showed that the window was not cloaked:
    HR=0
    CLOAKED=0
    

    Troubleshooting attempted before recovery:

    • Windows app Repair: no effect
    • Reset: no effect
    • uninstall/reinstall from Microsoft Store: no effect
    • normal packaged activation / direct AppX activation: no immediate effect
    • a Win32 ShowWindow(..., SW_SHOW) attempt against the hidden Chrome_WidgetWin_0 was issued earlier, but the UI did not appear immediately

    The application eventually became visible later during process/window diagnostics. At the moment it appeared, the command being run was a read-only Get-CimInstance Win32_Process query to identify the main packaged ChatGPT.exe (no --type= argument). That query itself should not change window state, so I cannot claim it caused recovery. A prior ShowWindow request may have completed asynchronously/delayed, or startup may have unblocked independently.

    The useful new data point is that this hidden-window/headless-startup condition is still reproducible on 26.903.8094.0, and the affected Chrome_WidgetWin_0 was explicitly confirmed as Visible=False while DWMWA_CLOAKED=0.

    No .codex project/session data was deleted or modified during diagnosis.

  6. QianSteveLei commented on Sep 13, 2026

    @QianSteveLei

    Recurrence on a newer Windows Store/MSIX build: OpenAI.Codex 26.908.4834.0 (x64).

    The same machine that previously reproduced this on 26.903.8094.0 reproduced the headless startup again after the app updated.

    Current package state:

    Name         Version       Status
    OpenAI.Codex 26.908.4834.0 Ok
    

    During the failed launch, direct Win32 enumeration again found the hidden Chromium top-level window:

    Found hidden ChatGPT window: PID=36328 HWND=855002
    Class=Chrome_WidgetWin_0
    

    ShowWindowAsync(hwnd, SW_SHOW) and SetForegroundWindow(hwnd) were issued, followed by a normal packaged reactivation via:

    explorer.exe shell:AppsFolder\OpenAI.Codex_2p2nqsd0c76g0!App
    

    At the time of this diagnostic, the key confirmed point is that the hidden-window/headless-startup bug still reproduces on 26.908.4834.0; package status remains Ok.

    This is a recurrence on the same system, not a first-launch/install-only event.

  7. CYZice commented on Nov 7, 2026

    @CYZice
    Image use this method in settings,just move it to C Image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions