codex - 💡(How to fix) Fix Codex hangs on startup at 'Starting MCP servers (2/3): codex_apps' [1 comments, 2 participants]

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…
GitHub stats
openai/codex#20167Fetched 2026-04-30 06:32:50
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×5commented ×1cross-referenced ×1

Codex CLI frequently appears frozen at startup on: Starting MCP servers (2/3): codex_apps

Error Message

  • fail fast with an explicit actionable error (network/auth/backend status) instead of appearing hung. failed to force-refresh tools for MCP server 'codex_apps' ... error sending request for url (https://chatgpt.com/backend-api/wham/apps)

Root Cause

Codex CLI frequently appears frozen at startup on: Starting MCP servers (2/3): codex_apps

RAW_BUFFERClick to expand / collapse

Summary

Codex CLI frequently appears frozen at startup on: Starting MCP servers (2/3): codex_apps

Environment

  • Codex CLI: 0.125.0
  • OS: macOS 26.3 (25D125)
  • Host: Apple Silicon
  • Date observed: 2026-04-29

Repro

  1. Start codex in terminal.
  2. Observe startup status line.
  3. It often stays on Starting MCP servers (2/3): codex_apps for a long time (minutes in user sessions).

Expected

Startup should either:

  • complete quickly, or
  • fail fast with an explicit actionable error (network/auth/backend status) instead of appearing hung.

Actual

The UI appears stuck on codex_apps startup for a long time.

Evidence from local logs

From ~/.codex/log/codex-tui.log:

  • 2026-04-27T07:24:29.633581Z
    failed to force-refresh tools for MCP server 'codex_apps' ... MCP startup failed: timed out handshaking with MCP server after 30s

  • 2026-04-28T08:28:02.773239Z
    failed to force-refresh tools for MCP server 'codex_apps' ... HTTP request failed ... url (https://chatgpt.com/backend-api/wham/apps)

  • 2026-04-22T07:19:09.903833Z (and multiple similar entries)
    failed to force-refresh tools for MCP server 'codex_apps' ... error sending request for url (https://chatgpt.com/backend-api/wham/apps)

Notes

  • This looks like connector startup / handshake resilience issue.
  • Even when eventual fallback may happen, UX currently resembles a freeze.

Suggested fix

  • Add clear startup timeout UX for codex_apps with visible reason.
  • Degrade gracefully: continue startup with cached tools and explicit warning banner.
  • Include retry backoff with user-visible status (attempt count + elapsed time).

extent analysis

TL;DR

Implement a retry mechanism with exponential backoff and display a visible timeout error message to handle the codex_apps startup issue.

Guidance

  • Review the codex-tui.log for patterns in the timeout and handshake failure errors to understand the frequency and potential causes.
  • Consider adding a user-visible status indicator for the retry attempts, including the attempt count and elapsed time, to improve the user experience.
  • Implement a degrade mode that allows the startup to continue with cached tools and displays an explicit warning banner when the codex_apps startup fails.
  • Evaluate the backend API endpoint https://chatgpt.com/backend-api/wham/apps for potential issues or rate limiting that may be contributing to the handshake failures.

Example

import time

max_attempts = 5
backoff_factor = 2

for attempt in range(max_attempts):
    try:
        # Attempt to start codex_apps
        start_codex_apps()
        break
    except TimeoutError:
        # Display visible timeout error message and retry
        print(f"Attempt {attempt+1}/{max_attempts} failed. Retrying in {backoff_factor**attempt} seconds...")
        time.sleep(backoff_factor**attempt)

Notes

The provided log entries suggest a potential issue with the backend API or network connectivity. The suggested fix focuses on improving the user experience and providing a more robust startup mechanism.

Recommendation

Apply workaround: Implement a retry mechanism with exponential backoff and display a visible timeout error message to handle the codex_apps startup issue, as this will provide a more robust and user-friendly experience.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING