Codex CLI 0.130.0 TUI becomes unstable/crashes on Windows when several subagents run and tool discovery returns repeated 403s

Open 💬 6 comments Opened May 16, 2026 by styler-ai
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

6 Comments

github-actions[bot] contributor · 2 months ago

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

  • #21899
  • #22962

Powered by Codex Action

styler-ai · 2 months ago

I reviewed the GitHub Actions potential duplicates:

  • #21899 is related, but not a duplicate. It covers the Windows App/CLI receiving Cloudflare challenge HTML from optional discovery endpoints, and a workaround by disabling apps/plugins/tool_suggest. This issue includes the same discovery 403 symptom, but the reported failure is the CLI/TUI becoming unstable during a multi-subagent run while the main session is waiting on several agents.
  • #22962 is related, but not a duplicate. It covers Codex Desktop showing "Oops, something went wrong" with WHAM/apps and plugin discovery errors. This issue is for the Codex CLI/TUI path, not the Desktop UI/app-server error state.

I think this issue should stay open because it combines a different failure mode:

  • Windows CLI/TUI, not only Desktop.
  • Several active subagent/session threads at once.
  • Repeated discovery 403 Forbidden warnings while wait_agent is waiting on multiple agents.
  • Websocket retry / missing thread connection context near the crash window.
  • A Windows CreateProcessAsUserW failed: 1312 signal earlier in the same session.

Related component issues I found while checking:

  • #19070 for the underlying discovery 403 Forbidden / Cloudflare challenge path.
  • #16821 for MCP/subagent interaction problems.
  • #22428 for Windows CreateProcessAsUserW failed: 1312.

So my read is: related cluster, but not a duplicate of #21899 or #22962.

TimaLytvynenko · 2 months ago

Same for me but with my local E ddrive

Pimpmuckl · 1 month ago

Experiencing the exact same issue:

78,840 errors of failed to load discoverable tool suggestions in codex-tui.log
as well as 2.4k remote installed-plugin cache failures

Latest W11, everything updated.

Each agent turn is unbelievably slow, it's been somewhat recent-ish I'd say.

styler-ai · 1 month ago

any update?

etraut-openai contributor · 1 month ago

If you are able to repro this, please use /feedback to upload logs and post the session ID here.