[Windows][26.721.4979.0] app-server disconnect/recovery causes full desktop app termination under concurrent tasks

Open 💬 5 comments Opened Jul 28, 2026 by christopher985
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

Summary

Since updating the Windows Codex desktop app to 26.721.4979.0, concurrent or high-load tasks can cause the Codex app-server connection to fail. The automatic recovery appears to succeed briefly, but the desktop window then disappears and the entire app terminates, interrupting every active task.

This is a regression for this machine: similar concurrent workloads worked before the recent update.

Related exact-version report: #35311. The trigger here is not limited to in-app Browser use; it also occurred with PDF test execution and an Android Gradle build running concurrently.

Environment

  • Codex desktop: 26.721.4979.0, x64 MSIX
  • OS: Windows 11 Home, 10.0.26200, x64
  • CPU: Intel Core i9-12900K
  • RAM: 127.7 GB
  • Package update timeline:
  • 26.721.3404.0 -> 26.721.3996.0 on 2026-07-24
  • 26.721.3996.0 -> 26.721.4979.0 on 2026-07-25
  • Repeated failures observed on 2026-07-28 KST

Reproduction patterns observed

Pattern A

  1. Start two separate, relatively small Codex tasks.
  2. Task 1 runs a full PDF regression/test suite.
  3. Task 2 runs an Android Gradle AAB build.
  4. Continue working in another Codex task.
  5. The app-server connection fails, recovery starts, and the entire desktop app terminates.

Pattern B

  1. Run an Android browser/DOM inspection task.
  2. In parallel, run an unrelated test/discovery task.
  3. Codex displays the Windows “ChatGPT stopped unexpectedly” screen or exits/restarts.

The issue has also recurred after moving work from older large threads into new small handoff threads.

Expected behavior

A failed tool, task, or app-server request should be isolated to that task. The desktop host should remain alive, and other tasks should continue running.

Actual behavior

The local app-server fails, the desktop recovery path briefly reconnects, then the main window lifecycle disappears and IPC breaks. All concurrent tasks are interrupted.

Relevant log sequence

Times below are UTC; local time is KST (UTC+9).

2026-07-28T14:48:49Z WARN stream disconnected - retrying sampling request
sampling_error="stream disconnected before completion: failed to send websocket request: Connection closed normally"

connection-failed code=3221225786 signal=null

2026-07-28T14:51:29Z AppServerConnection Restart requested
2026-07-28T14:51:33Z app_server_restart_recovery_done resumedCurrentConversation=true
2026-07-28T14:51:37Z IAB_LIFECYCLE route window is not live
2026-07-28T14:51:37Z IpcRouter Socket error errorCode=EPIPE errorMessage="write EPIPE"
2026-07-28T14:51:37Z Stopping app-server transport

A separate failure at approximately 2026-07-28 22:58:52 KST ended with the same IAB_LIFECYCLE window removal and EPIPE sequence.

Memory pressure ruled out for these failures

An external passive monitor recorded system memory every ~10 seconds. It never terminates Codex or changes process state.

For the 23:51 KST failure:

  • 23:48:46: physical memory 16.40%, commit 18.62%
  • 23:51:34: physical memory 20.63%, commit 21.48%
  • More than 100 GB of physical RAM remained available

For the earlier 22:58 failure, physical memory was about 14–15% and commit was about 14%.

There was no Windows Resource Exhaustion event 2004 around the failures. Recent task transcripts were also small (roughly 1–3 MiB) and had balanced tool-call/tool-output records, so this is not the previously observed very-large-transcript/compaction case.

Additional observations

  • The process exit/recovery failure leaves some child workloads, such as Gradle/Kotlin daemons, alive after the desktop app is gone.
  • No matching Windows Error Reporting crash entry was produced for the observed termination.
  • Reopening interrupted tasks can retrigger the app-wide failure.
  • Raw task transcripts are not attached because they may contain private project content. Sanitized desktop log excerpts and a screenshot can be provided privately to OpenAI support.

Please investigate the Windows app-server recovery and renderer/window lifecycle path in 26.721.4979.0, especially the interaction between a failed sampling/WebSocket stream, app-server restart, browser-session window cleanup, and IPC client unregister/EPIPE handling.

View original on GitHub ↗

5 Comments

github-actions[bot] contributor · 1 month ago

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

  • #35210
  • #35311

Powered by Codex Action

christopher985 · 1 month ago

Additional single-thread reproduction (2026-07-29 KST)

This issue reproduced again with only one Codex workload active, so concurrent tasks are not required.

Environment remains Codex desktop 26.721.4979.0 on Windows 11 x64.

Timeline

Times below are UTC (KST = UTC+9).

2026-07-28T16:30:59.911Z ERROR write_stdin failed: Unknown process id 86678
2026-07-28T16:31:35Z       A new pytest process (session 65982) started
2026-07-28T16:33:14Z       The test run had reached approximately 70%
2026-07-28T16:33:14.697Z   app_server_connection.closed code=3221225786
2026-07-28T16:33:14.698Z   Codex CLI process exited classifiedAsExpected=false
2026-07-28T16:33:48.982Z   Codex CLI initialized after automatic restart
2026-07-28T16:33:50.390Z   app_server_restart_recovery_done resumedCurrentConversation=true

The recovered thread was marked with its latest turn status as interrupted; the running test result was lost.

The Unknown process id 86678 was the most recent router error recorded in the app-server close reason. It occurred after attempting to poll an already-finished long-running command. A different, newly started process was active when the app-server exited. This is correlation, not proof that the stale process poll caused the exit, but it provides a narrower reproduction path:

  1. Run a long shell/test process and poll it with write_stdin.
  2. Let that process finish or disappear.
  3. Poll the stale process ID and receive Unknown process id.
  4. Start another long shell/test process and continue polling.
  5. The Codex CLI/app-server exits unexpectedly while the new process is still active.

Memory and transcript size

Memory pressure was again ruled out at the failure time:

  • Physical memory used: about 14.9%
  • Physical memory free: about 108.7 GB
  • Commit used: about 13.7%
  • Codex private memory: about 0.20 GB

The affected thread transcript was approximately 20.57 MiB / 4,577 lines, far below the previously observed pathological transcript sizes.

A later app restart also logged the already reported secondary lifecycle sequence:

IAB_LIFECYCLE route window is not live
IpcRouter Socket error errorCode=EPIPE errorMessage="write EPIPE"
Stopping app-server transport

The generated project artifacts remained intact, but final verification was interrupted. Please investigate whether stale unified-exec process polling or app-server recovery on Windows can terminate the host process instead of returning an isolated tool error.

zhouzho798-creator · 1 month ago

怎么解决,我也是

christopher985 · 1 month ago

Root cause narrowed: descendant process termination can take down the Windows app-server

I now have a deterministic local reproducer and a mitigation that removes the crash.

Stronger reproduction

Environment is unchanged:

  • Codex Desktop: 26.721.4979.0
  • app-server: 0.146.0-alpha.3.1
  • Windows 11 x64
  • fatal exit: 3221225786 / 0xC000013A

The failing workload was a Python/pytest suite that tests file-lock recovery with multiple subprocesses. The application code under test contained this Unix-style PID liveness probe:

os.kill(pid, 0)

Python's Windows documentation states that, except for CTRL_C_EVENT and CTRL_BREAK_EVENT, os.kill uses TerminateProcess; signal 0 is therefore destructive on Windows rather than a read-only existence probe:
https://docs.python.org/3/library/os.html#os.kill

This project bug caused a descendant/sibling test process to be terminated. However, the Codex failure was not isolated to the tool invocation: the main Codex app-server also exited with 0xC000013A, all desktop tasks were interrupted, and the active turn was left without a tool result.

I reproduced the same whole-app failure:

  1. In the original long thread.
  2. Again after restarting with only three MCP servers, all available (3/3; no unavailable server).
  3. In a separate small diagnostic thread.
  4. With the pytest child created using CREATE_NEW_PROCESS_GROUP; Codex still terminated.

Two affected full-suite tool calls were persisted without outputs. Desktop logs recorded:

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

The crash dialog again promoted an unrelated last WARN (for example, plugin defaultPrompt validation) as the apparent cause.

Thread corruption ruled out

The original rollout was validated independently:

  • 81,585,612 bytes
  • 35,892 JSONL records
  • 0 JSON parse errors
  • 5 unmatched tool calls, all explainable as residue from interrupted app-server exits

Therefore malformed rollout JSON was not the direct trigger in this reproduction.

Local mitigation and A/B result

I changed the Windows branch to bypass os.kill completely and use a read-only Win32 process query (OpenProcess + GetExitCodeProcess).

A regression test now fails if the Windows path calls os.kill.

Before the fix:

  • The exact full test file repeatedly terminated Codex Desktop/app-server.

After the fix:

python -m pytest tests/test_instagram_graph_io.py -q
.................................... [100%]
36 passed in 1.95s

The app-server remained alive, the original thread resumed, and subsequent tool executions completed.

Why this still appears to be a Codex Windows isolation bug

The project code's destructive Windows PID probe was a valid trigger that needed fixing. But a descendant tool process terminating another descendant should fail that tool or process tree only. It should not terminate the main Desktop app-server or every unrelated task.

Please investigate Windows unified-exec process-tree/job-object/console cleanup when a descendant process is terminated, including whether cleanup propagates a control event to the app-server. A useful regression test would run a tool that spawns two children, forcibly terminates one child, and verifies that the app-server and unrelated tasks remain alive.

Related reports with the same exit code and misleading last-WARN diagnostics include #21761.

mingisrookie · 24 days ago

Independent reproduction on a newer Windows Desktop build

I can independently reproduce the same failure mode on a newer Codex Desktop build, with the same project-side trigger described in the root-cause comment above.

Environment

  • Windows x64, native PowerShell
  • Codex Desktop MSIX package: 26.727.6591.0
  • Desktop client reported in app-server requests: 26.727.51351
  • Bundled session runtime: 0.146.0-alpha.9.2

Trigger and timeline

A newly added Python unittest suite exercises a project lock's PID-liveness check:

os.kill(pid, 0)

The suite was invoked through Desktop custom exec three times:

2026-08-03T08:00:58Z  full unittest module
2026-08-03T09:22:08Z  focused set including the concurrent-lock test
2026-08-03T09:29:54Z  full unittest module again

Each invocation was persisted as a completed custom_tool_call, but no matching custom_tool_call_output was written. The corresponding codex.exe app-server generation disappeared within roughly 2–3 seconds and Desktop started a replacement process.

The outer ChatGPT.exe process remained alive and responsive throughout. I found:

  • no matching Windows Application Error / WER event;
  • no Crashpad dump;
  • no Resource Exhaustion event 2004;
  • more than 13 GB of physical memory free.

This matches the issue's distinction: the project has a real Windows bug that should be fixed, but termination/control events from a tool descendant should not take down the shared Desktop app-server.

Persisted task state after recovery

The affected rollout is valid JSONL but now has three unmatched custom tool calls. Reopening/resuming it logs:

Custom tool call output is missing for call id: <redacted>

This is also closely related to #32653. The thread can sometimes start another turn after restart, but running the same suite again repeats the app-server exit and adds another unmatched call.

Questions for maintainers

  1. Is there a supported recovery path for an existing Desktop task containing interrupted/unmatched custom tool calls, without manually editing or back-patching the rollout JSONL?
  2. Should users archive the affected task and continue in a fresh task, or is there a supported way to quarantine/mark the interrupted turn as failed and safely resume the same task?
  3. Is Windows descendant-process / console-control isolation expected to be fixed in a build newer than 26.727.6591.0, or is this still an open app-server/unified-exec issue?

For now I am avoiding the affected task and the triggering test command. I can provide sanitized process-span and SQLite log excerpts if useful.