codex - 💡(How to fix) Fix Codex CLI 0.130.0 TUI becomes unstable/crashes on Windows when several subagents run and tool discovery returns repeated 403s

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

The Codex CLI TUI crashed or disconnected during a long-running Windows session that had several subagent/session threads active at once. The local logs show many repeated failed to load discoverable tool suggestions: request failed with status 403 Forbidden warnings, websocket stream retries, and missing analytics context warnings while the main thread was waiting on multiple agents. This latest crash does not appear to be the older known taskkill /T /F nested-Codex cleanup issue; targeted searches found no current taskkill / SUCCESS: The process lines in the crash window except our later diagnostic searches.

Error Message

  1. Earlier in the same period, several tool calls failed with Windows process creation error CreateProcessAsUserW failed: 1312. Codex should degrade gracefully if tool discovery returns 403s or if a child agent/session cannot load optional tool suggestions. A failing subagent should report an error to the main TUI without causing the whole interactive session to disappear, disconnect, or become unrecoverable. 2026-05-16T15:07:27Z ERROR codex_core::tools::router: 2026-05-16T15:30:50Z WARN codex_core::session::turn: 2026-05-16T15:30:50Z WARN codex_core::session::turn: 2026-05-16T15:39:47Z WARN codex_analytics::reducer: 2026-05-16T15:40:01Z WARN codex_analytics::reducer:

Root Cause

There is a separate older Windows issue in this workspace where nested codex exec --ephemeral reviewer runs could trigger taskkill /T /F cleanup and kill the active shell. This report is probably a different issue because the latest crash window has no direct taskkill evidence.

Fix Action

Fix / Workaround

Suggested workaround while investigating

Code Example

2026-05-16T15:07:27Z ERROR codex_core::tools::router:
  exec_command failed ... CreateProcessAsUserW failed: 1312

---

Get-Content phase2_workspace_diff.md
Get-Content MEMORY.md
Get-ChildItem -Name
Get-Content memory_summary.md
Get-ChildItem -Name extensions

---

2026-05-16T15:30:50Z WARN codex_core::session::turn:
  failed to load discoverable tool suggestions: request failed with status 403 Forbidden: <html>...

---

2026-05-16T15:30:50Z WARN codex_core::session::turn:
  stream disconnected - retrying sampling request (1/5 in 212ms)...

---

2026-05-16T15:29:04Z ToolCall: wait_agent
  targets=[3 redacted agent/session IDs]
  timeout_ms=180000

2026-05-16T15:36:17Z ToolCall: wait_agent
  targets=[6 redacted agent/session IDs]
  timeout_ms=180000

2026-05-16T15:39:24Z ToolCall: wait_agent
  targets=[6 redacted agent/session IDs]
  timeout_ms=300000

---

2026-05-16T15:39:47Z WARN codex_analytics::reducer:
  dropping tool item analytics event: missing analytics context ... missing_context="thread_connection"

2026-05-16T15:40:01Z WARN codex_analytics::reducer:
  dropping compaction analytics event: missing analytics context ... missing_context="thread_connection"
RAW_BUFFERClick to expand / collapse

Summary

The Codex CLI TUI crashed or disconnected during a long-running Windows session that had several subagent/session threads active at once. The local logs show many repeated failed to load discoverable tool suggestions: request failed with status 403 Forbidden warnings, websocket stream retries, and missing analytics context warnings while the main thread was waiting on multiple agents. This latest crash does not appear to be the older known taskkill /T /F nested-Codex cleanup issue; targeted searches found no current taskkill / SUCCESS: The process lines in the crash window except our later diagnostic searches.

Environment

  • Codex CLI: codex-cli 0.130.0
  • OS: Windows, native PowerShell
  • Workspace: private local workspace, path redacted
  • Model: gpt-5.5
  • Reasoning effort: xhigh
  • Sandbox: danger-full-access
  • Approval policy: never
  • Relevant config flags:
    • features.multi_agent = true
    • features.rmcp_client = true
    • features.unified_exec = true
    • features.skills = true
    • features.shell_snapshot = true
    • rmcp_client = true

What happened

  1. A long-running Codex CLI TUI session was doing broad private repository work.
  2. The run used multiple subagents/session threads. The main session repeatedly called wait_agent against several agent IDs.
  3. While agents were active, many concurrent session threads started logging repeated 403 Forbidden failures when loading discoverable tool suggestions.
  4. At least one thread logged a websocket stream disconnect retry.
  5. Earlier in the same period, several tool calls failed with Windows process creation error CreateProcessAsUserW failed: 1312.
  6. The user observed another crash and had to reopen/resume the session.

Expected behavior

Codex should degrade gracefully if tool discovery returns 403s or if a child agent/session cannot load optional tool suggestions. A failing subagent should report an error to the main TUI without causing the whole interactive session to disappear, disconnect, or become unrecoverable.

Actual behavior

The session became unstable while multiple agent sessions were active. Logs show repeated warning loops across child/session threads, retries, and missing thread connection context near the crash window.

Evidence from local logs

Times below are UTC from C:\Users\<user>\.codex\log\codex-tui.log.

2026-05-16T15:07:27Z ERROR codex_core::tools::router:
  exec_command failed ... CreateProcessAsUserW failed: 1312

This happened for several simultaneous commands such as:

Get-Content phase2_workspace_diff.md
Get-Content MEMORY.md
Get-ChildItem -Name
Get-Content memory_summary.md
Get-ChildItem -Name extensions

Repeated tool-discovery failures then appeared across active threads:

2026-05-16T15:30:50Z WARN codex_core::session::turn:
  failed to load discoverable tool suggestions: request failed with status 403 Forbidden: <html>...

A stream retry also appeared:

2026-05-16T15:30:50Z WARN codex_core::session::turn:
  stream disconnected - retrying sampling request (1/5 in 212ms)...

The main thread was waiting on multiple agents:

2026-05-16T15:29:04Z ToolCall: wait_agent
  targets=[3 redacted agent/session IDs]
  timeout_ms=180000

2026-05-16T15:36:17Z ToolCall: wait_agent
  targets=[6 redacted agent/session IDs]
  timeout_ms=180000

2026-05-16T15:39:24Z ToolCall: wait_agent
  targets=[6 redacted agent/session IDs]
  timeout_ms=300000

Near the same window, analytics context warnings appeared:

2026-05-16T15:39:47Z WARN codex_analytics::reducer:
  dropping tool item analytics event: missing analytics context ... missing_context="thread_connection"

2026-05-16T15:40:01Z WARN codex_analytics::reducer:
  dropping compaction analytics event: missing analytics context ... missing_context="thread_connection"

Extra observation

There is a separate older Windows issue in this workspace where nested codex exec --ephemeral reviewer runs could trigger taskkill /T /F cleanup and kill the active shell. This report is probably a different issue because the latest crash window has no direct taskkill evidence.

Privacy note

The full log file is very large and contains private prompts, local paths, and private project content. I can provide a redacted slice around 2026-05-16T15:07:00Z to 2026-05-16T15:40:10Z, plus sanitized config and version output. I would not attach the full raw codex-tui.log publicly without redaction.

Suggested workaround while investigating

  • Limit parallel subagents to one or two on Windows.
  • Avoid nested codex exec reviewer sessions inside a Codex TUI session.
  • If the same 403 Forbidden tool-discovery loop starts repeating, stop spawning/waiting on more agents and continue in the main session until the run stabilizes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Codex should degrade gracefully if tool discovery returns 403s or if a child agent/session cannot load optional tool suggestions. A failing subagent should report an error to the main TUI without causing the whole interactive session to disappear, disconnect, or become unrecoverable.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING