Skip to content

Codex Desktop closes immediately after launch on Windows #16502

Open

Description

@woeowiegj

Title: Codex Desktop closes immediately after launch on Windows

Environment:

  • Windows 10 Home (build 26200.8117)
  • Codex Version: 26.325.3894.0 (tested also 26.325.2171, 26.313.5234)
  • Platform: x64
  • WSL: Not installed
  • Installation: Microsoft Store + Uptodown (both tested)

Steps to Reproduce:

  1. Launch Codex from Start menu or Microsoft Store
  2. App window appears
  3. After 2-3 seconds, window closes automatically

What I've verified:

  1. Changed sandbox = "elevated" → "unelevated" → no effect
  2. Disabled all MCP servers in config.toml - no effect
  3. Ran as Administrator - no effect
  4. Tested with empty workspace - still crashes
  5. WSL is not installed (not the WSL-no-distro bug)
  6. CLI version works perfectly (0.118.0)
  7. Tested multiple Codex versions - all crash

Error logs:

  • sandbox.log shows repeated ACL permission failures on WindowsApps path
  • Event Viewer shows no crash events
  • No application-level crash dumps found

What works:

  • Codex CLI (npm install -g @openai/codex) works fine

This matches known issues:

Requested help:
Looking for any workaround or hoping this is a known issue with a fix coming.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Apr 2, 2026
  2. github-actions commented on Apr 2, 2026

    @github-actions
    Contributor
  3. Sebjugate commented on Apr 5, 2026

    @Sebjugate

    I posted in a related issue that it had something to do with my git repo. In my case I wasn't really using git so I just deleted the .git folder and Codex started working again.

  4. johnsilvavlogs commented on Apr 7, 2026

    @johnsilvavlogs

    Another detailed datapoint on this from a different Windows machine. This looks close to #16502, and it may also overlap with #16834 because I see MCP -32601 warnings during startup, but I have not proven those warnings are the root cause.

    Environment

    • Windows 11 Pro 10.0.26200 x64
    • Store package: OpenAI.Codex_26.325.3894.0_x64__2p2nqsd0c76g0
    • App-server logs identify the desktop client as app_server.client_version="26.325.31654"

    Clean repro

    I can reproduce this from a clean launch with no interaction:

    1. Kill any existing WindowsApps Codex processes.
    2. Launch with:
      Start-Process explorer.exe 'shell:AppsFolder\\OpenAI.Codex_2p2nqsd0c76g0!App'
    3. Do nothing.
    4. The process tree reaches 6 Codex processes and one real window.
    5. Around 54-55 seconds later it drops to 1 process, then 0, and the window disappears.

    I reproduced this twice today. One run exited at about 46 seconds; the clean rerun exited at about 55 seconds.

    What Windows reports

    • App activation succeeds normally. The only matching TWinUI event I found is:
      • Microsoft-Windows-TWinUI/Operational
      • Event ID 1621
      • Activation of app OpenAI.Codex_2p2nqsd0c76g0!App attempted ... The operation completed successfully.
    • During the failing repro window I did not get a Codex-specific:
      • Application Error
      • Windows Error Reporting
      • WER crash bucket / report archive entry

    So on this machine it does not look like a normal native faulting-module crash. It looks more like a controlled teardown / lifecycle exit after startup.

    Last strong internal signals before exit

    From C:\Users\T-GAMER\\.codex\\logs_1.sqlite, for the packaged desktop app-server process (...\\app\\resources\\codex.exe app-server), the last notable signals before teardown were:

    startup remote plugin sync failed ... https://chatgpt.com/backend-api/plugins/list ... 403 Forbidden
    failed to warm featured plugin ids cache ... https://chatgpt.com/backend-api/plugins/featured ... 403 Forbidden
    Failed to list resource templates for MCP server 'openaiDeveloperDocs': Mcp error: -32601: Method not found
    Failed to list resources for MCP server 'openaiDeveloperDocs': Mcp error: -32601: Method not found
    Failed to list resource templates for MCP server 'vercel': Mcp error: -32601: Method not found
    Failed to list resources for MCP server 'vercel': Mcp error: -32601: Method not found
    app-server event: app/list/updated targeted_connections=0
    serve_inner: serve finished quit_reason=Cancelled
    

    Important caveat: I am not claiming the 403 plugin sync or MCP Method not found warnings are definitely the root cause. I am only reporting that they are the last strong app-internal signals I could correlate before the process tree disappears.

    Control case: direct binary launch stays alive

    If I launch the binary directly instead of going through the packaged AppX entry, it stays up and behaves normally for at least 2+ minutes:

    & "C:\Program Files\WindowsApps\OpenAI.Codex_26.325.3894.0_x64__2p2nqsd0c76g0\app\Codex.exe" \
      --enable-logging=file \
      --log-file=C:\path\to\codex_desktop_direct_launch.log \
      --v=1

    In that direct-launch mode:

    • the process tree remains alive
    • the window stays open
    • Electron verbose networking continues normally
    • I do not see the same immediate self-exit behavior

    That makes me suspect the failure is specific to the packaged Windows Store / AppX launch/lifecycle path rather than the Codex.exe binary itself.

    Older history on this machine

    Reliability Monitor on this same machine also contains older Codex hangs:

    • 2026-03-10: Codex.exe version 908.0.0.0, Application Hang (1002)
    • 2026-03-13: Codex.exe version 993.0.0.0, Application Hang (1002)

    Those are not the same repro as today, but they may indicate a broader Windows desktop stability problem in this line of builds.

    If useful, I can also provide the exact PowerShell polling loop I used to time the exit and the exact sqlite query I used to isolate the app-server log rows.

  5. johnsilvavlogs commented on Apr 7, 2026

    @johnsilvavlogs

    Possible related issue: #16834.

    On my machine, the packaged Windows desktop app also emits MCP -32601 Method not found warnings during startup (openaiDeveloperDocs, vercel) before the app tears itself down around 46-55 seconds after launch. I also see startup-time 403 Forbidden responses on plugins/list and plugins/featured.

    I have not proven those warnings are the root cause here, but there is enough overlap that these may be the same startup/lifecycle bug or two adjacent failure modes in the same path.

  6. gcllq commented on Apr 29, 2026

    @gcllq

    I also encountered automatic exit without any valid information. But after reinstalling, it can run stably for a period of time, but once I exit, it will automatically exit, and I can only continue reinstalling

  7. 5andysalive commented on May 3, 2026

    @5andysalive

    "If I launch the binary directly instead of going through the packaged AppX entry, it stays up and behaves normally for at least 2+ minutes:

    & "C:\Program Files\WindowsApps\OpenAI.Codex_26.325.3894.0_x64__2p2nqsd0c76g0\app\Codex.exe" \ 2"

    that solved it for me. It ran all day without closing. Just started it from that exe via double click. I hate Windows Store apps btw.
    I have certain things concerning windows update blocked in my firewall, that maybe the issue. But looking at the issues here, it probably wasn't.

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

    appIssues related to the Codex desktop appbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions