Skip to content

[Windows][26.820.7780.0] Desktop launches suspended, leaks orphan codex.exe, fails to load/send threads, then silently relaunches #40972

Open

Description

@nukleerbey

Summary

On Windows, Codex/ChatGPT Desktop package OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0 entered a multi-stage failure state during normal use:

  1. After closing the app, it could not be reopened normally.
  2. A newly activated ChatGPT.exe was created but remained permanently suspended: ~2.5 MB working set, 1 thread, MainWindowHandle=0, CPU=0, with ThreadState=Wait / WaitReason=Suspended.
  3. Manually calling NtResumeProcess returned 0 and immediately restored the app to a normal Electron process tree (~338 MB, 64 threads, nonzero window handle).
  4. The previous codex.exe app-server did not terminate. It remained as an orphan with a dead parent PID and only 1 thread, even after taskkill /F and Stop-Process -Force.
  5. After recovery, an existing task/thread would not load its content. Later, messages would not submit and older tasks/chats would not load.
  6. A full Windows restart did not resolve the thread/history/send failures.
  7. The Desktop app then closed and reopened by itself. The old main ChatGPT.exe disappeared, but its codex.exe app-server again remained orphaned; a new main process and a new codex.exe app-server were created.
  8. Windows Application Event Log contained no matching ChatGPT, Codex, or OpenAI crash event during the observed self-relaunch window.

This appears to be a Desktop lifecycle / activation / app-server cleanup / state-sync regression rather than a single stuck UI process.

Environment

  • OS: Windows 11 x64
  • Codex/ChatGPT Desktop MSIX package: 26.820.7780.0
  • Package identity: OpenAI.Codex_2p2nqsd0c76g0
  • Installed executable path: C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\ChatGPT.exe
  • Bundled app-server path: C:\Users\<user>\AppData\Local\OpenAI\Codex\bin\d0097be4feba73d0\codex.exe

Evidence: permanently suspended launch

Direct AppX activation succeeded in creating a process:

Start-Process explorer.exe -ArgumentList 'shell:AppsFolder\OpenAI.Codex_2p2nqsd0c76g0!App'

But the resulting process was effectively uninitialized:

Id               : 12128
ProcessName      : ChatGPT
Responding       : True
MainWindowHandle : 0
Handles          : 0
Threads          : 1
CPU              : 0
WorkingSet       : 2588672

Thread state:

Id     ThreadState  WaitReason
33780  Wait         Suspended

The process command line was simply:

"C:\Program Files\WindowsApps\OpenAI.Codex_26.820.7780.0_x64__2p2nqsd0c76g0\app\ChatGPT.exe"

Calling NtResumeProcess manually:

Add-Type @"
using System;
using System.Runtime.InteropServices;
public static class NativeMethods {
    [DllImport("ntdll.dll")]
    public static extern int NtResumeProcess(IntPtr ProcessHandle);
}
"@

$p = Get-Process -Id 12128
[NativeMethods]::NtResumeProcess($p.Handle)

returned:

0

Immediately afterward the same process became healthy:

Id               : 12128
CPU              : 16.609375
WorkingSet       : 337772544
Threads          : 64
MainWindowHandle : 396952

The Suspended wait reason disappeared and the full Electron child tree was spawned.

Evidence: orphaned app-server that cannot be cleaned up

Before the successful resume, an older app-server was left behind:

PID       : 27900
Name      : codex.exe
Parent PID: 28572
CPU       : 7.875 s
Threads   : 1

The parent process no longer existed.

Its command line showed the normal Desktop app-server invocation with the bundled codex_app MCP server and a per-instance named pipe.

Both of these failed to remove it:

taskkill /PID 27900 /T /F
Stop-Process -Id 27900 -Force

Stop-Process -Force returned without an error, but the same PID, CPU time, working set, handle count, and single thread remained visible afterward.

Its sole remaining thread was:

ThreadState: Wait
WaitReason : Executive

After the resumed ChatGPT.exe initialized normally, it created a new healthy app-server:

codex.exe PID 15380
Parent PID 12128
Threads 41

while orphan PID 27900 remained.

Evidence: thread/history/send failures

After the app was manually recovered:

  • The Desktop shell rendered normally.
  • An existing task/thread could be selected from the sidebar, but its conversation/task content remained blank and would not load.
  • Later, messages would not submit.
  • Older tasks/chats would not load.
  • A full Windows restart did not resolve these failures.

This is similar to #40968 for prompt submission, but in this case it occurred together with suspended activation, orphan app-server leakage, thread/history loading failures, and later self-relaunch.

Evidence: silent self-relaunch and second orphan

Later, without the user intentionally closing the app, the main Desktop process changed.

The previous main process (ChatGPT.exe PID 12128) disappeared, leaving its app-server (codex.exe PID 15380) orphaned with one thread.

A completely new process tree then started:

15380  codex    26.08.2026 23:33:11.516  Threads=1   RAM=151.8 MB   # old orphan
35796  ChatGPT  26.08.2026 23:42:26.818  Threads=55  RAM=342.8 MB   # new main
5012   ChatGPT  26.08.2026 23:42:26.899  Threads=8   RAM=9.6 MB
14528  ChatGPT  26.08.2026 23:42:27.251  Threads=23  RAM=225.6 MB
29024  ChatGPT  26.08.2026 23:42:27.255  Threads=22  RAM=55.6 MB
24872  ChatGPT  26.08.2026 23:42:27.271  Threads=10  RAM=22.4 MB
5236   ChatGPT  26.08.2026 23:42:28.667  Threads=31  RAM=324.6 MB
35700  ChatGPT  26.08.2026 23:42:28.667  Threads=31  RAM=207.4 MB
22424  codex    26.08.2026 23:42:28.759  Threads=40  RAM=120.1 MB   # new active app-server
2268   ChatGPT  26.08.2026 23:42:33.141  Threads=35  RAM=261.3 MB
12992  ChatGPT  26.08.2026 23:42:33.142  Threads=12  RAM=35.0 MB

Process ancestry confirmed:

codex.exe 15380 -> parent 12128 (parent no longer exists)
ChatGPT.exe 35796 -> new main process
codex.exe 22424 -> parent 35796 (new healthy app-server)

The new Desktop tree therefore started while the previous app-server remained orphaned.

A query of the Windows Application event log for the previous 15 minutes returned no ChatGPT, Codex, or OpenAI matching crash/error event, so the visible close/reopen may have been an internal relaunch/self-recovery rather than a conventional WER-recorded crash.

Expected behavior

  • AppX activation should resume the main ChatGPT.exe automatically; the user should never need to call NtResumeProcess manually.
  • Closing/restarting/relaunching Desktop should terminate its codex.exe app-server and associated per-instance resources.
  • A new Desktop instance should not leave previous app-server processes orphaned.
  • Existing threads/tasks should reliably load after launch/restart.
  • Prompt submission should either succeed or return a clear actionable error; it should not silently fail.
  • If Desktop performs an internal recovery/relaunch, it should preserve thread state and cleanly tear down the previous process tree.

Related issues

The combination above reproduces on the current 26.820.7780.0 package and persisted even after a full Windows restart.

Activity

  1. added
    bug
    app
    windows-os
    app-server
    on Aug 26, 2026
  2. skstussy commented on Aug 29, 2026

    @skstussy

    I am experiencing what appears to be the same regression after the recent Codex Desktop update on Windows 10.
    In my case it is now completely blocking Codex:

    • Existing chats are visible in the sidebar but do not load when clicked.
    • New chats cannot be created successfully. After submitting the first prompt, the request gets stuck and the conversation is not persisted.
    • Work jobs also get stuck and do not start.
    • Restarting Codex and signing out/in did not resolve the problem.
    • This started immediately following the Codex update/restart.
      I submitted diagnostics using the built-in Send Feedback function.
      Feedback ID: no-active-thread-01a04c2a-e91d-7fa2-b0cd-f07dacf1bcf0
      The issue is currently preventing me from using Codex Desktop for both existing and new Work sessions.
  3. glarionenko commented on Sep 2, 2026

    @glarionenko

    Reproducing this on the latest Microsoft Store Stable build as of 2026-09-03:

    • Windows x64
    • OpenAI.Codex 26.901.1978.0 (Status: Ok)
    • Previous affected Stable build on the same machine: 26.825.6671.0
    • Beta also installed/tested: OpenAI.CodexBeta 26.727.4816.0
    • Feedback/session ID: 01a04541-a03b-7403-9f21-143b8f3e8391

    Current symptom after updating to 26.901.1978.0: the Desktop app shows the existing chat/thread list in the sidebar, but selecting an existing thread leaves the conversation content blank / stuck loading. New chats in the same project can be created and work normally.

    During troubleshooting I also observed the same lifecycle pattern described in this issue: ChatGPT.exe can disappear while its codex.exe ... app-server remains running. One Stable app-server was left with a dead parent PID; taskkill /F reported that no instance of the task was running, and CIM Terminate returned ReturnValue: 2. A Windows reboot was required to clear it.

    After a clean reboot with no Codex/ChatGPT processes running and after disabling a user Startup shortcut, the issue still reproduces. Updating Stable from 26.825.6671.0 to 26.901.1978.0 did not fix the missing thread contents.

    I also tested Beta 26.727.4816.0 from a clean state: it can open the project and attempt to resume the thread, but the historical content still does not load; its GUI process then disappears while the Beta codex.exe app-server remains.

    Standalone npm CLI is codex-cli 0.150.1 (D:\CodexTools\npm\codex.cmd). codex resume --all finds the existing session and enters Resuming session…, which suggests the thread/session metadata is still present. The failure appears specific to resuming/hydrating existing thread history rather than creating new threads.

  4. glarionenko commented on Sep 7, 2026

    @glarionenko

    Follow-up: still reproducible on Stable 26.901.6511.0; same persisted thread can work in one process lifetime, then stay blank after restart, and the orphan app-server can survive sign-out

    Reproducing again on Windows x64 on 2026-09-07 with Microsoft Store Stable:

    • OpenAI.Codex 26.901.6511.0
    • current Desktop app-server path: C:\Users\<user>\AppData\Local\OpenAI\Codex\bin\8e5b6932251c2c1c\codex.exe
    • affected historical thread is the same thread I referenced in my previous comment.

    There are two persistent symptoms that appear related.

    1. Existing thread is listed, but its conversation body does not hydrate after restart

    The thread remains present in the sidebar, but selecting it can leave the conversation body blank/loading indefinitely after restarting Codex. This has continued across several Desktop updates.

    This does not look like simple transcript corruption or a hard size limit:

    • The parent rollout was inspected read-only and is valid JSONL end-to-end: 30,125 lines, 0 parse errors.
    • The paginated history projection was fully caught up to the rollout: projection byte offset exactly matched the rollout file size and the next ordinal matched the last JSONL ordinal + 1.
    • The parent rollout is ~52.7 MiB with 24 turns / 10,173 projected items.
    • It has four direct historical subagents with rollouts of approximately 307.32 MiB, 141.81 MiB, 69.11 MiB and 1.13 MiB.

    Most importantly, the same unchanged historical thread later opened successfully in Stable 26.901.1978.0 / bundled core 0.153.0-alpha.5 after waiting. Once open, it worked normally:

    • the old /root/developer, /root/reviewer, and /root/runtime_deployer subagents were accessible;
    • a new test subagent could be created and completed successfully;
    • the parent thread could continue normally.

    After later restarts, the same thread can again remain blank. So large history may amplify hydration cost, but it is not sufficient to explain the failure by itself: the exact same persisted graph is sometimes fully usable and sometimes fails to hydrate after process restart.

    This still looks consistent with a restart/resume/hydration/lifecycle race or state-sync problem rather than data loss.

    2. codex.exe app-server becomes an unkillable orphan and prevents a clean Desktop restart

    On the current 26.901.6511.0 build, closing the Desktop UI left this app-server behind:

    Name            : codex.exe
    PID             : 2112
    Parent PID      : 20372 (no longer exists)
    Executable      : ...\OpenAI\Codex\bin\8e5b6932251c2c1c\codex.exe
    Command line    : ... app-server --analytics-default-enabled ...
    Working set     : ~251 MiB
    Handles         : 522
    

    Attempts to terminate it from an elevated Administrator PowerShell:

    taskkill /PID 2112 /T /F
    -> cannot terminate; parent 20372; no instance of the task is running
    
    taskkill /PID 2112 /F
    -> no instance of the task is running
    
    Stop-Process -Id 2112 -Force
    -> returns without error, but PID 2112 remains visible in Get-Process, tasklist and CIM
    

    After Stop-Process -Force, .NET reported:

    HasExited  : True
    Threads    : 1
    RAM        : ~251 MiB
    Handles    : 522
    WaitForExit(5000) : False
    

    The sole remaining thread was:

    ThreadState      : 5  (Waiting)
    ThreadWaitReason : 0  (Executive)
    

    CIM termination returned:

    Invoke-CimMethod Win32_Process.Terminate
    ReturnValue : 2
    

    The orphan survives Windows sign-out

    I then signed out of Windows and signed back in. The new interactive console session became Session 2, but the orphan stayed in the old Session 1:

    query session
    services                         0  Disc
                                     1  Down
    console            <user>       2  Active
    

    codex.exe still existed as PID 2112 in Session 1 with HasExited=True.

    Only these processes remained in Session 1:

    csrss.exe   760
    codex.exe  2112
    

    Both of these session cleanup attempts reported success / no error but did not remove Session 1 or PID 2112:

    reset session 1
    logoff 1 /V
    

    The orphan still holds the live Codex databases

    Sysinternals handle.exe -p 2112 shows that the stuck app-server continues to hold handles to the active Codex state, including:

    ~\.codex\thread_history_1.sqlite
    ~\.codex\thread_history_1.sqlite-wal
    ~\.codex\thread_history_1.sqlite-shm
    ~\.codex\state_5.sqlite
    ~\.codex\state_5.sqlite-wal
    ~\.codex\state_5.sqlite-shm
    ~\.codex\logs_2.sqlite
    ~\.codex\logs_2.sqlite-wal
    ~\.codex\goals_1.sqlite*
    ~\.codex\memories_1.sqlite*
    ~\.codex\queue_1.sqlite*
    ~\.codex\tmp\arg0\...\.lock
    

    This is particularly concerning because a new Desktop instance may start while the old, half-terminated app-server still owns the same SQLite/WAL state.

    Sysinternals cleanup attempts also failed:

    • PsKill as Administrator: access denied / unable to kill.
    • PsExec -s ... taskkill /PID 2112 /F: still reports no instance of the task is running.
    • PsExec -s ... pskill 2112: also fails.

    At this point only a full Windows reboot appears able to remove the stuck app-server/session.

    User-visible impact

    This creates a repeating recovery loop:

    1. Existing historical thread is visible but may not load after restart.
    2. Closing/restarting Desktop can leave codex.exe app-server in a half-terminated orphan state.
    3. The orphan keeps the Codex SQLite/WAL files open.
    4. Normal relaunch can fail to produce a usable Desktop window.
    5. Even Windows sign-out/sign-in is insufficient because the old session remains Down with the orphan process.
    6. A full machine reboot becomes necessary just to obtain a genuinely clean Codex process state.

    Requested investigation / questions

    1. Can Desktop own its app-server in a Windows Job Object (or equivalent) so it cannot survive the GUI/session teardown in this state?
    2. Why does the app-server reach a state where process termination has apparently been signaled (HasExited=True) but the EPROCESS/thread/handles remain and even SYSTEM-level termination cannot reap it?
    3. Can Desktop refuse to launch a second app-server against the same CODEX_HOME while a previous instance still owns the SQLite/WAL files, and surface an actionable recovery message instead?
    4. For the blank historical thread, can the selected-thread resume/hydration path be made deterministic and bounded (metadata/recent tail first) rather than depending on full graph hydration during restart?
    5. Is there a supported doctor / rehydrate / clean app-server restart procedure for Windows that does not require rebooting the entire machine?

    No private transcript contents, credentials, auth files, tokens, or raw databases are included. I can provide additional sanitized process/session/handle output if maintainers need a specific diagnostic.

  5. canyrtcn commented on Oct 4, 2026

    @canyrtcn

    Reproduced again on a newer Windows Desktop build, so this regression appears to persist beyond 26.820.7780.0.

    Environment

    • Windows 11 Pro x64
    • Codex Desktop MSIX: OpenAI.Codex_26.930.3930.0_x64__2p2nqsd0c76g0
    • Package identity: OpenAI.Codex_2p2nqsd0c76g0
    • Bundled app-server path currently under %LOCALAPPDATA%\OpenAI\Codex\bin\8aaf1547b825b104\codex.exe

    Reproduction observed repeatedly

    1. Start from a clean state with no ChatGPT.exe or codex.exe user processes running and CodexSandboxService.OpenAI.Codex in Running state.
    2. Click Codex once.
    3. A main ChatGPT.exe process is created, but no window appears.
    4. The process is effectively uninitialized:
      • CPU = 0
      • MainWindowHandle = 0
      • ThreadCount = 1
      • Responding = True
      • sole thread: ThreadState=Wait / WaitReason=Suspended
    5. Calling NtResumeProcess on the main ChatGPT.exe returns 0.
    6. The Codex window opens immediately without another click.
    7. Sometimes chat/thread content loads normally after resume. On other runs, the shell opens but existing conversations do not load.
    8. In one run the app then closed and reopened by itself. After the relaunch the shell returned, but conversation content stopped loading.
    9. Multiple codex.exe app-server processes can accumulate. The currently active app-server is the child of the current main ChatGPT.exe; older ones remain orphaned with dead parent PIDs.
    10. Observed orphan app-server threads in Wait / Executive. Stop-Process -Force can return without actually removing the process. Stopping CodexSandboxService.OpenAI.Codex caused one such orphan to disappear, but the suspended-launch problem reproduced again on the next clean launch.

    Example suspended frontend observed on this build:

    CPU              : 0
    HandleCount      : 0
    ThreadCount      : 1
    MainWindowHandle : 0
    Responding       : True
    
    ThreadState : Wait
    WaitReason  : Suspended
    

    The working manual recovery is still:

    Add-Type @"
    using System;
    using System.Runtime.InteropServices;
    public static class CodexResumeFix {
        [DllImport("ntdll.dll")]
        public static extern int NtResumeProcess(IntPtr ProcessHandle);
    }
    "@
    
    $p = Get-Process -Id <main ChatGPT.exe PID>
    [CodexResumeFix]::NtResumeProcess($p.Handle)

    Return value is 0, and the window appears immediately.

    This makes the failure mode look extremely similar to the original report, but it is still reproducible on 26.930.3930.0. The combination of suspended AppX activation, orphaned app-server processes, occasional self-relaunch, and thread/history hydration failure is still present.

    A watchdog/self-recovery for a main process that remains Wait/Suspended, plus reliable teardown of the previous app-server during relaunch, would likely remove the need for manual recovery. Happy to provide additional logs/diagnostics if useful.

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

    appapp-serverbugwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions