Long-lived ChatGPT-auth CLI sessions can stall on codex_apps while fresh sessions load instantly (403 Cloudflare HTML on connectors/apps discovery)

Open 💬 2 comments Opened Apr 24, 2026 by GigiTiti-Kai

Description

I am seeing a session-age-dependent startup degradation on Codex CLI with ChatGPT login.

Fresh/lightweight sessions on the same machine/account/network initialize apps/MCP quickly, but long-lived sessions can stall for minutes showing:

Starting MCP servers (2/3): codex_apps

When that happens, local logs show apps/connectors discovery failing with 403 Forbidden and a Cloudflare challenge HTML page instead of JSON.

This does not appear to be a broken local install:

  • fresh sessions work immediately on the same machine/account/network
  • I upgraded to codex-cli 0.124.0 and re-ran codex logout / codex login
  • the problem still reproduces only on long-lived sessions

Environment

  • Codex CLI: 0.124.0
  • Auth mode: ChatGPT login (not API key)
  • Platform: WSL2 Linux
  • Kernel: Linux KAI 6.6.87.2-microsoft-standard-WSL2 x86_64
  • Node: v24.12.0
  • npm: 11.13.0

What I observe

Fresh / lightweight session

  • starts normally
  • apps/connectors load essentially immediately

Long-lived session

  • can hang for minutes at Starting MCP servers (2/3): codex_apps
  • local logs show full apps list load failing and falling back
  • the failing response is Cloudflare challenge HTML from chatgpt.com/backend-api/..., not JSON

Representative local evidence:

failed to load full apps list; falling back to installed apps snapshot: Failed to load apps: Request failed with status 403 Forbidden: <html>

The returned HTML includes the Cloudflare challenge text:

Enable JavaScript and cookies to continue

One failing path I captured locally was:

/backend-api//connectors/directory/list?external_logos=true

I also observed the same general Cloudflare/403 symptom family discussed in other issues, but the important isolation detail here is that a fresh new CLI session works immediately while the older long-running session degrades into this state.

Steps to reproduce

I do not have a tiny deterministic repro yet, but this is the pattern I can reproduce repeatedly:

  1. Start Codex CLI using ChatGPT auth
  2. Keep using the same session for a long time (multiple hours / heavy ongoing work)
  3. At some point, apps-related startup/initialization paths begin hanging for minutes
  4. Open a fresh/lightweight new session on the same machine/account/network
  5. Observe that the fresh session initializes apps immediately

Expected behavior

If apps/connectors discovery is blocked or challenged, Codex CLI should fail open quickly (or skip that discovery path) instead of looking hung on codex_apps. Also, long-lived sessions should not degrade this way while fresh sessions on the same machine still work.

Related issues

This looks related to the broader Cloudflare challenge / app discovery family, especially:

  • #16543
  • #16341
  • #16618
  • #16808
  • #17860
  • #17880

But this report adds a specific repro pattern: session age matters. Fresh sessions succeed; older long-lived sessions are the ones that degrade.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗