Skip to content

Windows: app-server killed with STATUS_CONTROL_C_EXIT (0xC000013A) mid command execution; regressed in 26.818.5229 after being fixed post-26.810 #40231

Open

Description

@baibaibai19910706

Summary

On Windows 10 (19045), the desktop app-server engine is repeatedly terminated with exit code 3221225786 (0xC000013A, STATUS_CONTROL_C_EXIT) a few minutes into any agent turn that executes local shell commands. Chat-only / idle sessions never die. The desktop shell shows "ChatGPT stopped unexpectedly" and restarts the engine; resuming threads with pending command turns re-triggers the kill, producing a crash/restart loop that makes the app unusable for local agent work.

The bug has now regressed twice across auto-updates — version bisection below, from one machine observed continuously over ten days.

Version timeline

All kill events from shell logs (%LOCALAPPDATA%\Codex\Logs\..., line Codex CLI process exited classifiedAsExpected=false code=3221225786):

Store build Dates observed Behavior
26.803.x through Aug 13 stable
26.810.4967 / .41047 / .52044 Aug 14–16 24 engine kills across two active days; death within 2–5 min whenever commands ran
builds current Aug 17–22 Aug 17–22 zero kills in six days; on Aug 23 daytime a single engine instance ran 15 h continuously with command activity
26.818.5229 (auto-updated Aug 23 ≈12:20 UTC) Aug 23 evening first kill within 8 minutes of the update landing; identical signature

Signature

  • Exit code always 3221225786, signal=null, classifiedAsExpected=false.
  • In the engine's internal log DB (logs_2.sqlite), the final rows before every death are item/commandExecution/outputDelta TRACE events — the engine dies mid command-output streaming. No ERROR or panic is logged; the process ends abruptly.
  • No WER report and no Application Event Log entry — consistent with a console control event (CTRL_C / CTRL_CLOSE delivered to the engine's console process group), not an access violation.
  • Correlation holds across every observed session: windows containing commandExecution events die within minutes (e.g. a 1205-row session with 221 commandExecution events died at 3 min 48 s); windows with zero commandExecution never die (e.g. an 817-row, 10-minute active session — zero deaths).

Ruled out locally (each isolated and tested; the kill persisted)

  • config.toml rebuilt to near-stock (and temporarily read-only-locked so the app could not rewrite it)
  • logs_2.sqlite reset (was 763 MB; reproduced with a fresh small DB)
  • state / queue / memories DBs: pragma integrity_check ok, all sqlx migrations ok
  • oversized thread rollouts (48–51 MB JSONL) quarantined
  • notify hook target (codex-computer-use.exe) disabled — tested on both cua_node runtime generations
  • all custom MCP servers disabled
  • bundled runtime PowerShell (~/.cache/codex-runtimes/codex-primary-runtime/dependencies/native/powershell) replaced with MSI PowerShell 7.6.4
  • Microsoft Store pwsh execution-alias bypassed by installing MSI PowerShell 7 onto PATH
  • Windows elevated sandbox disabled ([windows] sandbox = "elevated" removed; verified zero sandbox-runner activity during a subsequent kill)
  • full app reinstall (same version), OS reboot; 64 GB RAM with 40+ GB free; no third-party EDR
  • VS Code extension and desktop confirmed at matching versions during tests

Workaround

Pinning the VS Code extension at 26.803.41515 restores a working command-execution path; the desktop app is stable as long as no local commands run.

Environment

  • Windows 10 Pro 10.0.19045 x64
  • Store package OpenAI.Codex, currently 26.818.5229.0
  • PowerShell 7.6.4 (MSI) and Windows PowerShell 5.1 both present

Possibly related (same exit code / restart loops): #16271, #21761, #33136.

Happy to provide shell-log or engine-log extracts for any of the kill events above.

Activity

  1. added
    bugSomething isn't working
    appIssues related to the Codex desktop app
    windows-osIssues related to Codex on Windows systems
    app-serverIssues involving app server protocol or interfaces
    tool-callsIssues related to tool calling
    on Aug 23, 2026
  2. github-actions commented on Aug 23, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. hauomu commented on Aug 24, 2026

    @hauomu

    Independent reproduction here on a second Windows machine, with the same .5229 signature.

    Environment

    • Store package: OpenAI.Codex 26.818.5229.0
    • Windows: Microsoft Windows NT 10.0.26200.0 (x64)
    • CPU: Intel Core i5-13600KF
    • RAM: 32 GB
    • Bundled Codex PowerShell: 7.6.4, tested healthy (PWSH_OK, exit code 0)

    Reproduction / frequency

    The desktop app showed “ChatGPT stopped unexpectedly” roughly 5 times in ~10 minutes during active Codex use.

    The Sentry breadcrumbs capture the same failure repeatedly:

    Child process exited with code '3221225786'
    [AppServerConnection] Codex CLI process exited classifiedAsExpected=false code=3221225786 connectionId=5 signal=null transport=stdio
    

    followed by another occurrence on the restarted app-server:

    [AppServerConnection] Codex CLI process exited classifiedAsExpected=false code=3221225786 connectionId=6 signal=null transport=stdio
    

    So this is again 3221225786 == 0xC000013A / STATUS_CONTROL_C_EXIT, with signal=null and classifiedAsExpected=false.

    As in the original report, I found no corresponding Windows Application Event Log crash and no Windows Error Reporting event for Codex/ChatGPT during the failures.

    Additional observation: thread-store projection error immediately before the deaths

    In my logs, the most recent internal Codex warning immediately before multiple app-server exits is consistently:

    failed to project durable rollout for 01a02b6a-3474-7343-9f46-4ffff6f54790:
    thread-store internal error: thread history projection for 01a02b6a-3474-7343-9f46-4ffff6f54790 expected ordinal 5001, got 5000
    

    I don't know whether this projection error is causal or merely the last warning emitted before the separate STATUS_CONTROL_C_EXIT termination, but it repeats across app-server restarts and may be useful for correlation. I have not deleted/reset the affected thread so the state can be preserved for further diagnosis.

    One other oddity: the installed/running package and codex.exe path are definitely .5229, while some retained Sentry event metadata still identifies the frontend release as codex@26.818.41509. That may simply be stale persisted Sentry state after the update.

    This therefore appears to reproduce #40231 on a substantially different Windows build as well, rather than being specific to 19045 or the original machine.

  4. hauomu commented on Aug 24, 2026

    @hauomu

    Follow-up from the independent Windows reproduction I added earlier: I tried the Microsoft Store ChatGPT (Beta) channel as a workaround for the Stable 26.818.5229.0 0xC000013A / STATUS_CONTROL_C_EXIT regression.

    Unfortunately, the Beta channel is also unusable on the same machine.

    Stable vs Beta result

    Stable: OpenAI.Codex 26.818.5229.0
      -> repeated app-server exits with 3221225786 / 0xC000013A
      -> desktop crash screen / unusable for command-heavy work
    
    Beta: OpenAI.CodexBeta 26.727.4816.0
      -> blocked at “Finish Windows setup”
      -> setup retry reports “Windows setup didn't finish”
      -> launching Beta itself elevated does not help
      -> “Continue with limited access” also refuses to enter the app
    

    For the Beta failure, UAC itself is healthy, both AppX packages report Status: Ok, the signed codex-windows-sandbox-setup.exe exists and validates as OpenAI-signed, and the Beta codex.exe app-server starts.

    After repeated Beta setup attempts, however, there is still no setup_marker.json, no deny_read_acl_state.json, no setup_error.json, and no CodexSandbox* local users. The newest existing sandbox log was not updated during the retries, suggesting the Beta onboarding flow is failing before helper invocation rather than inside ACL/WFP/DPAPI setup.

    I opened a separate report for that Beta regression: #40346.

    The practical impact is that both current Windows desktop channels are blocked on this machine: Stable by this .5229 app-server termination regression, and Beta by a separate onboarding/setup regression. That leaves CLI as the only viable Codex path for getting work done.

  5. BWdhZ commented on Aug 24, 2026

    @BWdhZ

    Additional Windows reproduction/evidence from Codex Desktop 26.818.8289.0 (the same behavior was also observed before the update on 26.818.3698.0).

    The Electron shell itself did not produce an AppCrash or dump. The bundled codex.exe app-server repeatedly exited and was restarted. Relevant sanitized desktop-log sequence:

    Custom tool call output is missing for call id: <redacted>
    Codex CLI process exited classifiedAsExpected=false code=3221225786
    

    3221225786 == 0xC000013A (STATUS_CONTROL_C_EXIT).

    Observed local timestamps (UTC+08:00):

    • 2026-08-21 11:49:59
    • 2026-08-21 14:08:33
    • 2026-08-24 18:52:08
    • 2026-08-24 18:52:37
    • 2026-08-24 19:01:48

    The affected persisted session contains 236 custom_tool_call records but only 231 custom_tool_call_output records (5 unmatched calls). All five unmatched calls were local exec/test invocations. Once the interrupted records were persisted, resuming that task repeatedly hit the missing-output validation path and restarted app-server, so the thread became effectively unrecoverable.

    A useful distinction from a generic native app crash:

    • no Codex/ChatGPT Application Error 1000 or Application Hang 1002 event;
    • no Codex/ChatGPT crash dump;
    • no GPU reset or OOM evidence;
    • the desktop shell survived/restarted the backend.

    This suggests two related hardening opportunities: prevent the Windows command/process path from terminating app-server with a console-control exit, and make session recovery tolerate or repair interrupted custom tool calls instead of fatally exiting on a missing output.

    Disclosure: this comment was prepared and posted by Codex at the account owner's request.

  6. williamxhero commented on Aug 24, 2026

    @williamxhero

    I can confirm the same failure on another Windows machine.

    Environment

    • Codex Desktop MSIX: 26.818.5229.0
    • Bundled app-server reported by Desktop: 0.149.0-alpha.4.1
    • Windows 11 Pro 10.0.26200 x64
    • Python 3.13
    • Local Windows workspace, not WSL

    Reproduction observed

    An agent turn executed:

    python -m unittest discover -s tests -p "test_router_core.py" -v

    The unittest process completed in approximately 4.5 seconds with ordinary Python test failures and thread exceptions. Immediately afterwards, the Desktop app-server exited with:

    app_server_connection.closed code=3221225786 signal=null
    Codex CLI process exited classifiedAsExpected=false
    fatal_error_broadcasted
    

    The command tool call was persisted in the thread transcript, but its corresponding tool output was not. This left a new dangling tool call and caused the resumed turn to be marked interrupted.

    A preceding git status --short --branch command in the same turn completed normally and its output was persisted.

    Repeatability

    The same thread has shown this sequence multiple times:

    1. Start a local unittest command.
    2. Unittest emits output, including ordinary non-zero test results.
    3. The app-server exits with 0xC000013A.
    4. Desktop restarts the app-server.
    5. The transcript contains the command call but no corresponding output.

    Repairing the dangling transcript records allowed the thread to resume, but the next execution of the unittest command generated a new dangling call. This indicates that transcript corruption is an aftermath of the app-server termination, not the original cause.

    Hook boundary

    A normal command produced its expected PostToolUse hook event. The failing unittest command produced no PostToolUse event, indicating that the app-server exited before the tool output was persisted and before post-tool hooks were invoked.

    No Ctrl+C, cancellation, or terminal close was initiated manually. No Windows Application Error / WER crash event was recorded for the bundled codex.exe process.

  7. fionasapples commented on Aug 24, 2026

    @fionasapples

    Fourth independent reproduction, 26.818.5229.0, with three datapoints I don't see in the thread yet: a same-day clean-reinstall control, a varying respawn gap, and a stable standalone-CLI control on the same machine.

    Environment

    • Store package OpenAI.Codex 26.818.5229.0 (x64), Windows 11 Home 10.0.26200, 64 GB RAM
    • Standalone winget Codex CLI 0.146.1 also installed (relevant below)

    Kills observed 2026-08-24 (shell log)

    2026-08-24T11:08:21.299Z error [AppServerConnection] Codex CLI process exited classifiedAsExpected=false code=3221225786 signal=null transport=stdio
    2026-08-24T15:20:09.425Z error [AppServerConnection] Codex CLI process exited classifiedAsExpected=false code=3221225786 signal=null transport=stdio
    

    Same signature as above: no WER report, no Application Event Log entry, no crash dump, RAM plentiful. Engine-log (logs_2.sqlite) tails match the OP: first kill mid item/commandExecution/outputDelta streaming; second kill 8 s after an item/commandExecution/terminalInteraction event during an active turn. Before the reinstall (below), the same package showed 6 further engine generations in one morning (lifetimes 1–18 min under command-heavy load), including a kill where the replacement engine spawned 7 s later.

    New datapoint 1: clean reinstall does not fix it

    Between the two kills above I did a full Remove-AppxPackage uninstall and a fresh Store install of the same .5229 build (package data folder recreated from scratch; ~/.codex preserved). First kill on the fresh install came ~16 minutes after relaunch, identical signature. This complements the OP's rule-out list: it is not install/package-state corruption either.

    New datapoint 2: respawn gap varies

    First kill → respawn in ~1 s (stdio_transport_spawned at 11:08:22.272Z). Second kill → respawn only after 2 m 10 s (15:22:19.916Z), a full outage window rather than a blip.

    New datapoint 3: standalone CLI on the same machine is unaffected

    As a control, a standalone winget Codex CLI 0.146.1 process ran continuous agent work on the same machine (long-running commands, a subagent, a 6-minute heartbeat test loop) for 5+ hours spanning both desktop kills — zero deaths. This makes machine-level externals (EDR, console tooling, power events) unlikely and points at the desktop bundle's app-server (0.149.0-alpha line) or its command/terminal path specifically.

    Aftermath matches the dangling-tool-call reports

    The 15:20Z kill orphaned the in-flight call. Every turn attempted on that thread afterwards failed for ~2 minutes (four distinct turn ids, 15:31:41Z–15:33:13Z, including during run_auto_compact{reason=ContextLimit phase=MidTurn}):

    ERROR codex_core::util: ...run_turn.prepare_sampling_request_input: Custom tool call output is missing for call id: call_OVqbtpRguOXZtqcrCFmrbAw4
    

    Same shape as the unittest reproduction above and #40400: transcript damage is aftermath, not cause.

    Happy to provide fuller shell-log or engine-log extracts for any of these events.

    Disclosure: this comment was prepared and posted by Claude at the account owner's request.

  8. fionasapples commented on Aug 24, 2026

    @fionasapples

    Follow-up to my earlier comment (the 26.818.5229 / Win11 26200 reproduction with the clean-reinstall control). We ran a deeper local-forensics + literature/source review pass on the kill mechanism. Summary of what it supports, with the reasoning available for scrutiny:

    1. The kill correlates with command interruption/cleanup, not output volume per se

    On this machine, 5 of the day's 7 highest outputDelta-rate seconds (313–974 events/s) were each followed by an app-server death within 7–86 s (4 deaths across ~9 h, so chance placement is implausible, though "high output" and "gets interrupted" are confounded by construction). The killed turns were running batched parallel file reads (Get-Content ... -First N / rg via the exec tool, yield_time_ms set) — precisely the class of child command that hits output caps/timeouts and gets interrupted or torn down. One death followed an item/commandExecution/terminalInteraction event by 8 s.

    2. "disconnecting slow connection after outbound queue filled" appears to be a red herring for the crash

    That warning comes from the transport's bounded outbound channel (CHANNEL_CAPACITY = 128, try_send → Full → drop that one websocket connection) — the #18203 / #19246 / #37526 lineage. It terminates a single connection and no process. In our incident it preceded death by 20 s but the exit itself still needs a console-control delivery.

    3. The exit signature is a console-control self-kill, and the absence of crash artifacts is the fingerprint

    0xC000013A with no WER report, no crash dump, and no Event Log entry is what the default console handler produces: an unhandled CTRL_C/CTRL_BREAK/CTRL_CLOSE reaches a process with no handler installed (Rust installs none by default) and the default handler calls ExitProcess(STATUS_CONTROL_C_EXIT) — a clean exit, so no crash reporting fires. On Windows a Ctrl event aimed at a child on a shared (hidden) console broadcasts to every attached process including the sender/parent; same footgun class as MiniZinc/minizinc-python#191, CPython bpo-11361, dotnet/msbuild#4832. The desktop stack's pty layer also performs the FreeConsole → AttachConsole(child) → Ctrl-C console-list dance during ConPTY cleanup (see #25272 for that helper in the wild), which can land the Ctrl-C on the app-server if it is attached at the wrong moment.

    4. This maps cleanly onto the version history

    PR #35655 (CLI 0.147.0) — "Terminate Windows non-TTY processes on interrupt" — deliberately routes Windows interrupts away from console signaling into the termination callback, and consumes the terminator after a successful interrupt. That is exactly the hazard class above. Consistent with it: a standalone winget CLI 0.146.1 on this same machine ran identical command-heavy work for 5+ hours spanning two desktop deaths with zero exits, while the desktop bundle (app-server 0.149.0-alpha line) died four times in a day. This looks like the #35655-era protection regressed (or is bypassed by the desktop pty path) in the alpha bundle shipped with 26.818.5229.

    5. Ruled out locally

    Cheap diagnostic + hardening suggestions

    1. Install a logging SetConsoleCtrlHandler in the app-server that records which event type (CTRL_C / CTRL_BREAK / CTRL_CLOSE) arrives before exit — one repro then names the delivery path.
    2. Spawn exec children with CREATE_NEW_PROCESS_GROUP | CREATE_NO_WINDOW (or a dedicated ConPTY) so control events can never target the app-server's group; scope any GenerateConsoleCtrlEvent to the child's own group id, never group 0; keep FreeConsole/AttachConsole enumeration out of the app-server process.
    3. On unexpected exit, synthesize an error output for orphaned tool calls so the resumed thread doesn't loop on "Custom tool call output is missing" (per my earlier comment and Windows desktop: Work Mode repeatedly restarts app-server during tool calls, leaves missing tool outputs, and consumes usage #40400 / Codex Desktop crashes entire application due to missing tool call result #32653).

    Disclosure: this comment was prepared and posted by Claude at the account owner's request.

  9. bmankowitz commented on Aug 27, 2026

    @bmankowitz

    Still reproducing on Store OpenAI.Codex 26.820.7780.0 (Windows 11 26200). Same exit 3221225786 / 0xC000013A.

    [features] unified_exec = false was already pinned. Desktop still persisted PTY write_stdin custom exec calls.

    Observed two stages on 2026-08-27:

    1. Overnight: app-server died mid-flight (code=3221225786) while shutting down an MCP client. Electron stayed up. Rollout kept unpaired custom_tool_call records (no matching output).
    2. Next morning: auto-thread/resume of that long-running task plus others. After a few minutes, shared app-server fatal-exited with Custom tool call output is missing for call id: … and code=3221225786. Other open threads died with it.

    No WER / AppCrash / Crashpad dump. Isolating the affected JSONL (move out of sessions/, do not back-patch) restored new chats.

    This is the #32653 resume-poison path sitting on top of the Windows console-control kill in this issue. Config pin + new chat after a prior quarantine did not prevent it.

    Details (sanitized) posted on #32653.

  10. Marc111111 commented on Aug 28, 2026

    @Marc111111

    Confirmed independently on a second Windows machine, and the regression persists in a newer build: OpenAI.Codex 26.825.4187.0.

    Environment:

    • Windows 11 x64, build 10.0.26200
    • Codex desktop 26.825.4187.0
    • One local project open
    • Failure occurred during local command execution

    Exact shell-log signature:

    2026-08-28T20:50:28.393Z
    app_server_connection.state_changed
    cause=transport_closed
    closeCode=3221225786
    currentState=connected
    nextState=error
    transport=stdio
    wasInitialized=true
    
    2026-08-28T20:50:28.394Z
    Codex CLI process exited
    classifiedAsExpected=false
    code=3221225786
    signal=null
    transport=stdio
    
    2026-08-28T20:50:28.394Z
    fatal_error_broadcasted
    errorMessage="(code=3221225786, signal=null)"
    

    The active task was subsequently recovered with latestTurnStatus=interrupted.

    There was no new Windows WER/Application Event entry for this backend termination. The desktop process survived/recovered, but the active command stopped without a sufficiently visible failure indication.

    The most recent warning retained before the termination was:

    2026-08-28T20:45:22.792320Z
    "remote control websocket writer was stopped"
    target=codex_app_server_transport::transport::remote_control::websocket
    

    I am not claiming that warning caused the termination; it was simply the latest preceding backend warning retained in the fatal-error context.

    This independently confirms the exact 0xC000013A / classifiedAsExpected=false signature and shows that it remains present in 26.825.4187.0.

  11. willguerin commented on Sep 1, 2026

    @willguerin

    Additional independent reproduction on a newer Windows Desktop build, with the same termination signature.

    Environment

    • Codex Desktop Store package: OpenAI.Codex 26.825.6671.0
    • Bundled app-server: 0.151.0-alpha.7.2
    • Windows 11 Home 25H2, build 26200.9168, x64
    • 64 GB RAM; NVIDIA RTX 3090 24 GB, driver 595.97
    • WSL 2.6.3, kernel 6.6.87.2-1

    Observed events

    The retained desktop logs contain five unexpected bundled codex.exe app-server exits:

    Local time (Europe/Madrid) UTC
    2026-08-30 22:31:59 2026-08-30 20:31:59Z
    2026-08-30 22:37:33 2026-08-30 20:37:33Z
    2026-08-31 09:23:31 2026-08-31 07:23:31Z
    2026-08-31 17:24:52 2026-08-31 15:24:52Z
    2026-08-31 18:28:54 2026-08-31 16:28:54Z

    Every event has the same sequence/signature:

    Codex CLI process exited classifiedAsExpected=false code=3221225786
    fatal_error_broadcasted
    websocket_reconnect_marked_threads_needing_resume
    

    3221225786 == 0xC000013A == STATUS_CONTROL_C_EXIT.

    The UI presents the generic failure/reload experience. The local app server is then restarted. At least for the final three events, Electron main-process logging continued across the engine death, supporting app-server termination rather than whole-desktop-process termination.

    Workload correlation

    The failures occurred during substantial concurrent local work in two independent projects (one Windows-native and one WSL-backed). Starting a fresh continuation thread did not eliminate the failures.

    Recovery logs marked multiple streaming threads as needing resume during earlier events (six for the first failures, three for another); the final two marked one. This suggests concurrent work amplifies the failure but is not a necessary condition.

    A durable Goal-based thread could resume after the UI/app-server recovery. A non-Goal thread could lose its in-flight operation and did not automatically resume.

    Resource and OS evidence

    A read-only system snapshot during comparable concurrent work did not show aggregate exhaustion:

    • about 38.5 GiB physical RAM free
    • about 62.3 GiB virtual memory free
    • pagefile usage about 6.4%
    • GPU about 1% utilized with about 22 GiB VRAM free
    • Codex process family about 2.8 GiB; vmmemWSL about 2.7 GiB
    • negligible disk queue

    No correlated Windows Application Error, Application Hang, WER crash, resource-exhaustion event, GPU/display reset, WSL failure, or backend HTTP 5xx/connection-reset sequence was found.

    There was noisy WSL Git-watcher EISDIR activity around the first two failures, but none around the final three, so it does not explain the recurring exit signature.

    Version correlation

    Within the retained 16-day desktop log window, there were no unexpected app-server exits before the current 0.151.0-alpha.7.2 engine family and five afterward. This is correlation rather than proof of regression, but it extends the same STATUS_CONTROL_C_EXIT failure through Desktop 26.825.6671.0.

    Raw logs, absolute paths, project names, thread IDs, and transcripts are intentionally omitted. Sanitized extracts can be provided through a secure support channel if requested.

  12. MoonlightEnola commented on Sep 11, 2026

    @MoonlightEnola

    Additional evidence: kernel-level (Sysmon) capture of the kill, still present on 26.903.9818.0

    Same signature as reported here. Adding forensics that the existing reports in this issue don't have:
    a kernel-level (Sysmon) record of the kill itself, plus 1 Hz process sampling.

    Environment (paths/usernames redacted)

    • Windows 11 10.0.26200, x64
    • Codex Desktop MSIX 26.903.9818.0 (installed 09-10 17:34 local)
    • Bundled app-server codex-cli 0.153.4
    • Crash occurs both before and after the 26.903.9818.0 update landed, i.e. the 26.818 regression is still present in 26.903.

    All kill events observed on this machine (Codex CLI process exited classifiedAsExpected=false)

    08-31 20:13:20   code=0x40010004  (1073807364, DBG_TERMINATE_PROCESS)
    09-10 09:07:54   code=0xC000013A
    09-10 09:23:35   code=0x40010004
    09-10 10:58:11   code=0xC000013A
    09-10 11:05:59   code=0xC000013A
    09-10 11:44:59   code=0xC000013A
    09-10 12:03:59   code=0xC000013A
    09-10 13:41:36   code=0x40010004
    09-10 13:59:13   code=0xC000013A
    09-10 14:34:01   code=0xC000013A
    09-10 19:00:50   code=0xC000013A      <-- after 26.903.9818.0 was installed
    09-10 19:47:01   code=0xC000013A
    09-10 21:00:51   code=0xC000013A
    09-11 08:41:27 / 09:09:54 / 09:36:05 / 09:57:11 / 10:12:52 / 10:49:12   code=0xC000013A
    09-11 12:00:03 / 12:03:37 / 12:34:00 / 12:49:16 / 14:34:47 / 15:21:14   code=0xC000013A
    
    => 25 kills total: 22 x 0xC000013A, 3 x 0x40010004 (DBG_TERMINATE_PROCESS).
    

    Sysmon capture of one kill (09-11 15:21:14 local)

    source time event
    1 Hz sampler 15:21:14.275 last sample: handles=569 threads=83 ws=203.0MB cpu=28.33s
    Sysmon ID 5 15:21:14.633 app-server (codex.exe) terminated
    desktop log 15:21:14.694 app_server_connection.closed closeCode=3221225786
    desktop log 15:21:14.702 Codex CLI process exited classifiedAsExpected=false code=3221225786
    desktop log 15:21:14.703 fatal_error_broadcasted
    desktop log 15:21:14.695 cause=start_process (auto-restart)

    Finding 1 — no process ever obtained PROCESS_TERMINATE on the app-server before it died.

    Sysmon ProcessAccess (ID 10) was enabled for the whole session, filtered on TargetImage ending with codex.exe.
    In the 2 s before the kill every access was query-only (0x1000, 0x1410, 0x101000).
    The only accesses carrying the terminate bit appear 0.2–0.3 s AFTER the process had already died:

    15:21:14.808  ChatGPT.exe (parent Electron)  GrantedAccess=0x1fffff   <- reaping
    15:21:14.811  csrss.exe                      GrantedAccess=0x1fffff
    15:21:14.892  conhost.exe                    GrantedAccess=0x1fffff
    

    (the parent's call trace at 15:21:14.808 lands entirely inside chrome.dll — Chromium's process-management path)

    => This is exactly what a console control event looks like: it is not delivered through OpenProcess,
    so it leaves no ProcessAccess record at all. It is not consistent with OpenProcess(PROCESS_TERMINATE) + TerminateProcess.

    Finding 2 — the console was not closed (rules out CTRL_CLOSE_EVENT)

    1 Hz sampling of the conhost.exe process count around the kill:

    15:21:13.217  conhost count = 11
    15:21:14.275  conhost count = 11   <- last frame of the dying process
    15:21:15.340  conhost count = 11   <- after restart
    

    A closed console would have taken its conhost with it. It did not.
    => leaves CTRL_C_EVENT / CTRL_BREAK_EVENT (note: taskkill without /F also delivers this class of signal).

    Finding 3 — no resource exhaustion

    1 Hz sampling of the app-server over the last 10 s of its life:

    15:21:05.775  handles 563  threads 82  ws 201.9MB  cpu 28.20s
    15:21:08.958  handles 569  threads 83  ws 203.0MB  cpu 28.30s
    15:21:14.275  handles 569  threads 83  ws 203.0MB  cpu 28.33s   <- last frame
    

    Handles +6, threads +1, working set +1.1 MB over 10 s. No leak, no handle exhaustion, no memory pressure.

    Finding 4 — the desktop spawn path was isolated and did not reproduce the kill (single sample)

    I launched the same kind of workload (codex exec running a read-only git/python loop) through a small launcher that called
    CreateProcess with CREATE_NEW_CONSOLE | CREATE_BREAKAWAY_FROM_JOB | CREATE_NEW_PROCESS_GROUP, closed the returned process
    handle immediately, and waited on a reopened handle carrying only SYNCHRONIZE | PROCESS_QUERY_LIMITED_INFORMATION
    (i.e. the parent provably had no terminate right).

    started pid=<redacted>  final flags = 0x01000210  (NEW_CONSOLE | BREAKAWAY_FROM_JOB | NEW_PROCESS_GROUP)
    waiter handle access = 0x101000   (NO PROCESS_TERMINATE)
    child exited  exitCode=0 (0x00000000)   lifetime=1111s   (18 m 31 s)
    
    terminate-capable ProcessAccess events during its whole lifetime: NONE
    

    Caveats, stated plainly: this is a single sample, and codex exec is a different runtime shape from the desktop
    app-server (no MCP servers, no browser-use session, no UI event stream). So this does not prove the desktop spawn path
    is the only trigger. But the one structural difference that stands out is CREATE_NEW_PROCESS_GROUP.

    Related

    Suggestion

    Regardless of the remaining root cause: spawning the app-server with CREATE_NEW_PROCESS_GROUP (and not sharing the parent's
    console) would make it immune to console control events aimed at a command's process group — a cheap, targeted mitigation
    that also matches the only isolation test that survived here.

    Happy to run any additional instrumented test you'd like (Sysmon is now also logging every taskkill.exe spawn and every
    child of the desktop process, so the next occurrence will show whether the taskkill cleanup cycle really fires at the kill).

  13. sergdz commented on Sep 12, 2026

    @sergdz

    The same backend failure still reproduces on Windows Desktop 26.908.4834.0 with bundled app-server 0.154.0-alpha.6.2: three unexpected exits after the update with code 3221225786 = 0xC000013A / STATUS_CONTROL_C_EXIT. The retained window contains 25 identical exits before the update.

    Separately, after the update, renderer/GPU children were killed and Windows recorded a top-level ChatGPT.exe Application Hang 1002 / WER MoAppHang; the whole desktop app closed and restarted. New issue: #45020

    I am not claiming that the app-server exit is proven to cause the Desktop hang; Windows recorded no exception code for the main process.

  14. willguerin commented on Sep 23, 2026

    @willguerin

    Follow-up from my Windows machine, at my request, with a different failure signature from the 0xC000013A app-server exits reported above. I am adding it here because it occurred during substantial concurrent Codex work; I am not claiming it has the same root cause.

    On 2026-09-23, before the subsequent update, the running Store package was OpenAI.Codex 26.917.6896.0 (bundled app-server 0.155.0-alpha.16). I perceived a Desktop UI freeze sometime between 13:45 and 21:00 Europe/Madrid. Retained logs show earlier thread/start request timeouts at 11:58–12:49 UTC, then a clear stall beginning around 18:31 UTC (20:31 Madrid):

    • [AppServerConnection] app_server_client_request_queue_rejected repeatedly reported inFlightRequestCount=6 and reason=queue-expired. Affected methods included thread/read, thread/resume, thread/list, config/read, and turn/steer.
    • Two thread_hydration spans failed with reason=timeout after approximately 234 and 247 seconds. Later thread/resume attempts timed out after 240 and 480 seconds.
    • Two composer submissions failed with App server request expired while queued.

    The Desktop was still logging navigation, and the app-server still received some requests. I found no unexpected app-server exit / 3221225786 signature, Codex WER/Application Error entry, or Crashpad dump for this incident. This points to a request/queue stall rather than proving a renderer crash or full process termination; what held the six in-flight slots is unknown.

    The WSL Git watcher emitted roughly 58,000 EISDIR warnings that day, including during the stall (possibly relevant load, not established as causal; see #33764). Remote-control/model-refresh timeouts also co-occurred. The later update to 26.917.8451.0 happened after this incident, so it is not a test of that build.

    Could maintainers check what kept those six requests in flight, and whether a stalled request can starve thread hydration/steering under concurrent workloads? Sanitized log excerpts can be provided.

  15. willguerin commented on Sep 24, 2026

    @willguerin

    Post-update recurrence of the request-queue stall described in my Sept 23 comment. This is still not a confirmed recurrence of the 0xC000013A process-exit signature.

    On 2026-09-24, the running Windows Store Desktop build was OpenAI.Codex 26.917.8451.0. The UI became unresponsive again, and I closed and reopened it. Retained Desktop logs show queue saturation starting about 07:26 UTC (09:26 Europe/Madrid): app_server_client_request_queue_rejected reported inFlightRequestCount=5, then 6, with reason=queue-expired. Config, app/plugin, model, thread-list, and thread-history requests expired after roughly 30–60 seconds. The renderer still logged successful navigation and some app-server responses during this period.

    At 07:28:21 UTC, the old instance logged Stopping app-server transport with cause=stop_process during my manual close; a fresh instance launched seconds later. I found no unexpected app-server exit / 3221225786, Windows Application Error/Hang or relevant System event, or Crashpad dump for this window. The WSL Git watcher continued to emit roughly 106 EISDIR warnings/minute, but its causal role is unknown. A post-relaunch snapshot showed about 29 GB of 64 GB physical RAM free; this is not a measurement during the freeze.

    This natural-use recurrence shows that 26.917.8451 did not eliminate the queue-stall behavior. It does not establish that concurrent heavy threads, WSL, or a particular repository caused it. The unresolved question remains which requests held the in-flight slots and why routine requests could not progress. Sanitized log excerpts are available.

  16. yougaset commented on Sep 25, 2026

    @yougaset

    Reproduced again on 2026-09-25 on a substantially newer Desktop build, with additional source-level evidence.

    Environment

    • Windows 11: 10.0.26200
    • Codex Desktop: 26.917.9434.0 (MSIX)
    • Bundled backend: codex-cli 0.155.0-alpha.16.4
    • npm CLI used for control test: 0.155.1

    Reproduction / control

    The same local repository, same conda environment, and same pytest command were tested through both paths:

    conda run -n hmi python -m pytest tests/integration/test_module_lifecycle.py -q --tb=short
    
    • CLI codex exec: succeeded in 14415 ms, 4 passed
    • Desktop: hung 3/3 times
    • Six CLI test runs during the same evening completed without this failure.

    Desktop log evidence

    On the third failure, the Desktop log recorded:

    13:19:23.261 app_server_connection.closed code=3221225786 connectionId=1
                   reason = "... Custom tool call output is missing for call id: ..."
    
    13:19:23.270 Codex CLI process exited
                   classifiedAsExpected=false
                   code=3221225786
    
    13:19:23.399 stdio_transport_spawned ... codex.exe pid=66956
    

    So the in-flight tool call is interrupted by an app-server exit with
    3221225786 == 0xC000013A == STATUS_CONTROL_C_EXIT, and Desktop immediately spawns a replacement backend.

    I found at least 8 non-normal backend exits on the same day (including this exact code and a few explicit hard-kill/debugger codes), so this is not a one-off process restart.

    Source-level findings from the exact bundled tag

    I inspected openai/codex tag rust-v0.155.0-alpha.16.4, matching the bundled backend exactly.

    1. The unified exec output collector itself is bounded:

      • process_manager.rs::collect_output_until_deadline()
      • waits are inside tokio::select! with a deadline
      • MAX_YIELD_TIME_MS = 30_000

      This rules out “the command-output collection loop waits forever” as the direct cause of a multi-minute UI freeze.

    2. Relevant awaits that are not wrapped in their own deadline include:

      • open_session_with_sandbox(...).await
      • interaction_lock().lock_owned().await
      • request_approval(...).await

      However, in the observed incident the backend process itself is terminated, so all in-process futures disappear with it.

    3. Missing custom-tool outputs appear to be a consequence, not the process-kill cause:

      • context_manager/normalize.rs detects a CustomToolCall without matching output and inserts an "aborted" output.
      • error_or_panic() only logs in release builds; it does not panic there.

    This matches the observed sequence:

    exec tool call in flight
      -> app-server receives console-control termination (0xC000013A)
      -> tool call never produces CustomToolCallOutput
      -> Desktop reconnects / respawns app-server
      -> the existing UI turn is not failed/aborted cleanly
      -> UI waits indefinitely
    

    Additional narrowing

    The Windows PTY/job path in this tag uses Job Objects / TerminateJobObject; I did not find GenerateConsoleCtrlEvent in the repository. So I still cannot identify the sender of the console control event statically.

    A plausible remaining hypothesis is that a child shell/conda process and the packaged codex.exe share a hidden console/process group and a console control event intended for a child reaches the app-server as well, but this part is not proven yet.

    The main new point is that the original 0xC000013A failure signature from this issue is still reproducible on 26.917.9434.0, and when it happens during a tool call the Desktop recovery path can leave the active turn permanently stuck.

    If useful, I can capture a minidump on the next reproduction to identify the exact termination path / console-event source.

  17. willguerin commented on Sep 29, 2026

    @willguerin

    Follow-up to my earlier reports: I have another unexpected bundled app-server exit, this time with only one active Codex working thread. This is distinct from the September 23–24 request-queue stalls I reported, where the diagnostic review did not find an unexpected process exit.

    Feedback ID: 01a0585f-ac70-72c1-abd3-0fc6b22b03b8

    Incident time: approximately 2026-09-29 00:01:54 UTC, or 02:01:54 CEST (Europe/Madrid).

    Environment

    • Windows desktop, native Windows repository.
    • Desktop app: 26.924.2738.0.
    • Bundled Codex app-server runtime: 0.158.0-alpha.2.1.
    • Separate standalone CLI: 0.152.0. This is not the runtime that exited.
    • Affected turn: gpt-6-sol, High effort.

    I was running only one working thread. The recovery session also reported no other active project-writing Codex session or repository-writing process.

    Diagnostic findings

    A read-only diagnostic pass over the local desktop and session logs reports this sequence:

    1. app_server_connection.closed.
    2. An unexpected Codex CLI process exited with code 3221225786, matching the decimal exit code in this issue.
    3. A new app-server process at approximately 02:01:54 CEST.

    The desktop itself remained running. The affected session has no result for its final tool call and no normal completion event. The diagnostic pass found no nearby recorded cancellation or context-compaction event and no pending approval or input request.

    The UI did show automatic context compaction earlier in the run, but Codex performed several operations afterward. I am not presenting that earlier compaction as the cause of the process exit. Nearby OAuth and usage-stream warnings also do not establish causation.

    Interrupted operation

    The final tool call started pytest on two local unit-test files with --maxfail=1, piping output to a local log. It collected 38 tests and wrote progress through 89%, but there is no final test summary or exit code. No matching test process survived when the diagnostic pass checked. The diagnostic did not rerun the tests.

    Before the interruption, static checks and frontend TypeScript compilation exited 0, and a separate focused unit-test group completed with 83 passed. The local repository remained clean at its preserved checkpoint. Recovery is paused, and the incomplete test group is not being counted as passed.

    What remains unknown

    The evidence supports an unexpected bundled app-server process exit and connection loss, rather than simply an assistant deciding to stop. The underlying cause remains undetermined. There is no evidence in this diagnostic implicating another Codex working session, and I do not know whether this shares the cause of my earlier concurrent-workload failures or the later queue stalls.

    Please correlate the feedback ID with the app-server exit at the UTC time above and investigate what triggered the termination during command execution. The practical issue is that the single-thread precaution did not prevent this occurrence, and the run stopped without reporting the interrupted command's outcome.

    Private repository names, absolute paths, raw logs, and unrelated session identifiers are omitted from this public comment. The diagnostic report identifies local desktop-log and partial test-output evidence for any further requested investigation.

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 appapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingtool-callsIssues related to tool callingwindows-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