codex - 💡(How to fix) Fix codex_apps MCP fails to initialize on Turkey network route with error decoding response body; succeeds from alternate US network egress [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#19576Fetched 2026-04-26 05:14:37
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Error Message

MCP startup failed: Transport send error: HTTP request failed: error decoding response body -> HTTP request failed: error decoding response body 3. Observe codex_apps MCP startup failure with error decoding response body. 7. The call fails with failed to get client and the same MCP startup error. WARN codex_tui::chatwidget: WARN codex_core::connectors: Transport send error: HTTP request failed: error decoding response body WARN codex_core::mcp_tool_call: tool call error: failed to get client Transport send error: HTTP request failed: error decoding response body

Root Cause

Caused by: MCP startup failed: Transport send error: HTTP request failed: error decoding response body

Fix Action

Fix / Workaround

This is not token_invalidated. The logs do not contain token_invalidated, and the failure is not fixed by treating it as a normal auth-refresh problem.

RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

v0.125.0

What subscription do you have?

Business

Which model were you using?

gpt-5.5 xhigh

What platform is your computer?

Linux 6.17.0-PRoot-Distro Ubuntu aarch64 aarch64

What terminal emulator and version are you using (if applicable)?

Termux

What issue are you seeing?

Problem

When starting Codex through a Turkey network route, the codex_apps MCP client fails to initialize.

Startup shows:

MCP client for `codex_apps` failed to start:
MCP startup failed: Transport send error:
HTTP request failed: error decoding response body

The /mcp command may still list GitHub tools, but this appears to be cached/startup tool metadata rather than a working live MCP client.

A real GitHub MCP tool call fails:

github_get_user_login
-> failed to get client
-> MCP startup failed
-> HTTP request failed: error decoding response body

Important distinction

This is not token_invalidated. The logs do not contain token_invalidated, and the failure is not fixed by treating it as a normal auth-refresh problem.

This also does not appear to be a GitHub connector authorization issue. The same account and connector can succeed from an alternate US network egress, where github_get_user_login returns the expected account login.

What steps can reproduce the bug?

Reproduction

  1. Use the Turkey network route.
  2. Start Codex.
  3. Observe codex_apps MCP startup failure with error decoding response body.
  4. Run /mcp.
  5. GitHub tools may be listed.
  6. Run a real tool call:
Use the GitHub MCP tool github_get_user_login and report only the login.
  1. The call fails with failed to get client and the same MCP startup error.
  2. Start Codex from an alternate US network egress.
  3. codex_apps initializes and github_get_user_login succeeds.
  4. Returning to the Turkey route after a successful initialization may allow MCP calls to work again.

Relevant log excerpts

WARN codex_tui::chatwidget:
failed to load full apps list; falling back to installed apps snapshot:
Failed to load apps: Failed to parse JSON response

WARN codex_core::connectors:
failed to force-refresh tools for MCP server 'codex_apps',
using cached/startup tools:
failed to get client:
MCP startup failed:
Transport send error:
HTTP request failed: error decoding response body

Real tool call failure:

ToolCall: mcp__codex_apps__github_get_user_login {}

WARN codex_core::mcp_tool_call:
tool call error: failed to get client

Caused by:
MCP startup failed:
Transport send error:
HTTP request failed: error decoding response body

What is the expected behavior?

Expected behavior

codex_apps should initialize reliably from the Turkey network route without requiring a successful prior initialization from another network egress.

If /mcp lists GitHub tools, a real GitHub MCP call should either work or clearly report that only cached tool metadata is available.

Actual behavior

/mcp may list GitHub tools, but live MCP client creation fails. This makes the tool list misleading as a health indicator.

Additional information

Hypothesis

This looks route- or edge-sensitive.

The failure appears to happen in Codex apps discovery or the codex_apps streamable_http MCP initialization path. The CLI may be receiving an invalid, truncated, or otherwise undecodable response during MCP client initialization.

The issue may be related to chatgpt.com edge routing for apps discovery / MCP initialization, rather than local repository configuration, GitHub connector authorization, or token invalidation.

Suggested improvement

  • Make codex_apps startup more resilient to transient decode failures.
  • Clearly distinguish cached /mcp tool metadata from a live working MCP client.
  • Add more specific logging for the failing endpoint and response class, without exposing tokens.
  • Retry MCP initialization or fall back more gracefully when apps discovery fails.

extent analysis

TL;DR

The issue can be mitigated by improving the resilience of codex_apps startup to transient decode failures, particularly when initializing through the Turkey network route.

Guidance

  • Investigate the streamable_http MCP initialization path for potential issues with response decoding, focusing on the Turkey network route.
  • Enhance logging for the failing endpoint and response class to provide more specific error information without exposing sensitive data.
  • Consider implementing retry mechanisms for MCP initialization or more graceful fallbacks when apps discovery fails.
  • Distinguish between cached /mcp tool metadata and a live working MCP client to avoid misleading health indicators.

Example

No specific code snippet can be provided without further details on the Codex CLI's internal implementation. However, a general approach to handling such errors might involve wrapping the MCP initialization in a retry loop with exponential backoff.

Notes

The exact cause of the error decoding response body issue is not specified, and without more information on the network conditions or the specifics of the Codex CLI's implementation, providing a precise fix is challenging. The suggestions aim to improve resilience and diagnostic capabilities.

Recommendation

Apply a workaround by enhancing the codex_apps startup resilience to transient decode failures, as this seems to be a route- or edge-sensitive issue. This approach can help mitigate the problem until a more permanent fix is identified and implemented.

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_apps should initialize reliably from the Turkey network route without requiring a successful prior initialization from another network egress.

If /mcp lists GitHub tools, a real GitHub MCP call should either work or clearly report that only cached tool metadata is available.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix codex_apps MCP fails to initialize on Turkey network route with error decoding response body; succeeds from alternate US network egress [1 comments, 2 participants]